aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/cpucontrol
Commit message (Collapse)AuthorAgeFilesLines
* cpucontrol: return selected revision from ucode_amd_find()Gleb Smirnoff2025-09-181-5/+6
| | | | | | | | | | | This fixes two printing bugs in cpucontrol(1). First, the utility will now print "updating from rev X to rev Y", instead of incorrect "updating to revision X", where X is actually the old revision. This also matches what Intel updater prints. Second, the utility won't incorrectly warn that the update failed after reading the new revision post update. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D52506
* cpucontrol: fix -DDEBUG buildGleb Smirnoff2025-09-091-0/+1
|
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* x86/ucode: add support for early loading of CPU ucode on AMD.Chuck Silvers2024-02-223-178/+10
| | | | | | Sponsored by: Netflix Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43318
* usr.sbin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-165-10/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-164-8/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-128-8/+8
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* cpucontrol(8): Fix a typo in an error messageGordon Bergling2022-01-261-1/+1
| | | | | | - s/incorret/incorrect/ MFC after: 1 week
* cpucontrol: fix extended signature matching code to avoid fallthoughDan Nelson2021-06-141-2/+2
| | | | | PR: 256502 MFC after: 1 week
* cpucontrol(8): Fix display.Konstantin Belousov2021-02-051-1/+1
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* Replace literal uses of /usr/local in C sources with _PATH_LOCALBASEStefan Eßer2020-10-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Literal references to /usr/local exist in a large number of files in the FreeBSD base system. Many are in contributed software, in configuration files, or in the documentation, but 19 uses have been identified in C source files or headers outside the contrib and sys/contrib directories. This commit makes it possible to set _PATH_LOCALBASE in paths.h to use a different prefix for locally installed software. In order to avoid changes to openssh source files, LOCALBASE is passed to the build via Makefiles under src/secure. While _PATH_LOCALBASE could have been used here, there is precedent in the construction of the path used to a xauth program which depends on the LOCALBASE value passed on the compiler command line to select a non-default directory. This could be changed in a later commit to make the openssh build consistently use _PATH_LOCALBASE. It is considered out-of-scope for this commit. Reviewed by: imp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D26942 Notes: svn path=/head/; revision=367075
* cpucontrol: print more useful information when MSR access fails.Konstantin Belousov2019-11-131-1/+1
| | | | | | | | | | | | | Instead of providing ioctl cmd value, which has no meaning to user, print MSR number. The later is what the user expects in this place even. Reported by: pstef Sponsored by: The FreeBSD Foundation MFC after: 3 days Notes: svn path=/head/; revision=354697
* cpucontrol: check for the supposed firmware file type and skipKonstantin Belousov2019-01-111-0/+2
| | | | | | | | | | | | | | | | non-regular entry. do_update() skips entries with DT_DIR type. This does not eliminate other entries that might exist in the directory. More, since NFS might fill d_type with DT_UNKNOWN, dot and dotdot entries are not skipped, then mmap(2) call failed for them when update microcode files are located on NFS. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=342934
* cpucontrol(8): De-duplicate common update logicConrad Meyer2018-11-146-228/+183
| | | | | | | | | | | | | Every µcode-updater must open the cpucontrol devfs node RDWR, open a firmware file, validate the FW file has a positive length, mmap it, etc. De-duplicate that identical logic between every individual platform. Also, constify references to the readonly-mapped firmware files while here. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=340421
* cpucontrol: correct typoEd Maste2018-09-111-1/+1
| | | | | | | | | | There should be no 't' in processort_rev_id. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=338591
* Use the existing MSR_BIOS_SIGN on AMD.Mark Johnston2018-07-131-2/+2
| | | | | | | | Reported by: kib Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=336263
* Use the name added in r336257.Mark Johnston2018-07-131-2/+2
| | | | | | | | MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=336258
* cpucontrol:Sean Bruno2018-06-121-4/+14
| | | | | | | | | | | | - fix debugging for family on AMD cpus and add useful debugging for which file is being selected for update. Reviewed by: cem Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15574 Notes: svn path=/head/; revision=335010
* cpucontrol: improve Intel microcode revision checkEd Maste2018-05-121-1/+8
| | | | | | | | | | | | | | According to the Intel SDM (Volme 3, 9.11.7) the BIOS signature MSR should be zeroed before executing cpuid (although in practice it does not seem to matter). PR: 192487 Submitted by: Dan Lukes Reported by: Henrique de Moraes Holschuh MFC after: 3 days Notes: svn path=/head/; revision=333569
* Make it possible to re-evaluate cpu_features.Konstantin Belousov2018-01-052-24/+69
| | | | | | | | | | | | | | | | | | | Add cpuctl(4) ioctl CPUCTL_EVAL_CPU_FEATURES which forces re-read of cpu_features, cpu_features2, cpu_stdext_features, and std_stdext_features2. The intent is to allow the kernel to see the changes in the CPU features after micocode update. Of course, the update is not atomic across variables and not synchronized with readers. See the man page warning as well. Reviewed by: imp (previous version), jilles Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13770 Notes: svn path=/head/; revision=327597
* Style. Remove useless return.Konstantin Belousov2017-12-281-8/+8
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=327284
* Complete r327264 by fixing yet another return without cleanup.Konstantin Belousov2017-12-281-1/+1
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=327283
* Use proper failure path rather than just returning.Warner Losh2017-12-282-2/+2
| | | | | | | CID: 1199354, 1006894, 1006893, 1006892 Notes: svn path=/head/; revision=327264
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-278-0/+16
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Update cpucontrol(8).Konstantin Belousov2017-09-301-13/+17
| | | | | | | | | | | | | | | | Mention new -n flag. Remove optional -h from the operation list lines, -h would cause the utility to exit without performing the action. Explain the default path behavior, list default path. Correct example of update performed from the non-default path, it needs -n and the trailing slash is redundand. Remove useless BUGS section. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=324114
* Allow to disable default microcode updates search path with the newKonstantin Belousov2017-09-301-5/+7
| | | | | | | | | | | | | | | | | | '-n' option. Look for updates in the default locations only after user-supplied locations are tried. If newer microcode files are put into non-standard path, both measures allow to avoid situation where older update loaded from the default path first, and then the second update is applied from non-standard path. Applying intermediate updates might be undesirable. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=324113
* Remove confusion in the line explaining syntax of the msr read.Konstantin Belousov2017-08-141-1/+2
| | | | | | | | | | Specify words order in the display. Sponsored by: The FreeBSD Foundation MFC after: 3 days Notes: svn path=/head/; revision=322493
* Add support for microcode update on newer AMD CPUs (10h+)Andriy Gapon2016-11-024-1/+352
| | | | | | | | | | | | | | | | | | | | | | | | | | This includes new code for parsing microcode files as well as the kernel-side change to apply the update on all processors at the same time. Developed with help from Borislav Petkov, formerly bp@amd64.org. Tested using Athlon II X2 processor on a system where BIOS does not have the latest microcode version: /boot/firmware/microcode_amd.bin: updating cpu /dev/cpuctl0 to revision 0x10000c7... done. The microcode file is taken from here: https://web.archive.org/web/20160528230514/http://www.amd64.org/microcode.html (note that the original site seems to be down at the moment) It can also be found here: https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/amd-ucode Reviewed by: kib, stas MFC after: 2 weeks Relnotes: maybe Differential Revision: https://reviews.freebsd.org/D8384 Notes: svn path=/head/; revision=308218
* Return usual error indicator to shell.Konstantin Belousov2016-06-161-1/+1
| | | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (hrs) Notes: svn path=/head/; revision=301963
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge head from 7/28Simon J. Gerraty2014-08-192-3/+67
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=270164
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * Sync with HEAD.David E. O'Brien2013-02-082-0/+6
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246555
| * \ Sync from headSimon J. Gerraty2012-11-042-2/+2
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | Restore the ABI of the cpuctl(4) ioctl request CPUCTL_CPUID, useKonstantin Belousov2014-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | separate argument structure with added level_type field for CPUID_CPUID_COUNT request. Reviewed by: attilio (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=267673
* | | | use .Mt to mark up email addresses consistently (part2)Baptiste Daroussin2014-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco@lastsummer.de> Notes: svn path=/head/; revision=267668
* | | | Following comments in r242565 add the possibility to specify ecx whenAttilio Rao2014-06-192-2/+66
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performing cpuid calls. Add also a new way to specify the level type to cpucontrol(8) as reported in the manpage. Sponsored by: EMC / Isilon storage division Reviewed by: bdrewery, gcooper Testerd by: bdrewery Notes: svn path=/head/; revision=267651
* | | Avoid clobbering errno with a call to fprintfEitan Adler2013-01-162-0/+6
| |/ |/| | | | | | | | | | | | | | | | | PR: bin/173923 Submitted by: Garrett Cooper <yanegomi@gmail.com> Approved by: cperciva MFC After: 3 days Notes: svn path=/head/; revision=245491
* | While 'make universe' passed this didn't work with clang.Eitan Adler2012-10-261-0/+2
| | | | | | | | | | | | | | | | | | | | This reverts r242120 Submitted by: Jan Beich Approved by: cperciva (implicit) Notes: svn path=/head/; revision=242159
* | This utility builds without NO_WCAST_ALIGNEitan Adler2012-10-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | Tested with make universe No objections from: stas Approved by: cperciva MFC after: 3 days Notes: svn path=/head/; revision=242120