aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/cpucontrol
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | More -Wmissing-variable-declarations fixes.Ed Schouten2012-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to adding `static' where possible: - bin/date: Move `retval' into extern.h to make it visible to date.c. - bin/ed: Move globally used variables into ed.h. - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. - usr.bin/calendar: Remove unneeded variables. - usr.bin/chat: Make `line' local instead of global. - usr.bin/elfdump: Comment out unneeded function. - usr.bin/rlogin: Use _Noreturn instead of __dead2. - usr.bin/tset: Pull `Ospeed' into extern.h. - usr.sbin/mfiutil: Put global variables in mfiutil.h. - usr.sbin/pkg: Remove unused `os_corres'. - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'. Notes: svn path=/head/; revision=241737
* | cpucontrol: use CPUCTL_UPDATE ioctl on correct file descriptorAndriy Gapon2012-06-031-1/+1
|/ | | | | | | | | | | I guess that means that microcode update has never worked for AMD CPUs. Please also note that only older AMD CPUs and micrcode file format are supported anyway (pre 10h family). MFC after: 1 week Notes: svn path=/head/; revision=236504
* Fixes to man8 groff mandoc style, usage mistakes, or typos.Warren Block2012-05-241-1/+1
| | | | | | | | | | PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb MFC after: 3 days Notes: svn path=/head/; revision=235873
* Hide DIR definition by making it an opaque struct typedef.Gleb Kurtsou2012-05-191-5/+5
| | | | | | | | | | | | | Introduce dirfd() libc exported symbol replacing macro with same name, preserve _dirfd() macro for internal use. Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable name to prevent shadowing global symbol. Sponsored by: Google Summer Of Code 2011 Notes: svn path=/head/; revision=235647
* Fix warning when compiling with gcc46:Eitan Adler2012-01-201-2/+1
| | | | | | | | | | error: variable 'flags' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Notes: svn path=/head/; revision=230360
* Use NO_WCAST_ALIGN for usr.sbin/cpucontrol; because this is only builtDimitry Andric2011-12-171-0/+2
| | | | | | | | | for x86, any alignment warnings can be safely ignored. MFC after: 1 week Notes: svn path=/head/; revision=228658
* Add VIA microde update support to cpuctl(4) and cpucontrol(8).Fabien Thomas2011-12-124-1/+288
| | | | | | | | | Support have been tested with X2 CPU and QuadCore CPU. MFC after: 1 month Notes: svn path=/head/; revision=228436
* - Save some space relying on the fact that all ioctl commandsStanislav Sedov2011-01-071-5/+5
| | | | | | | | | prefixes are the same. Suggested by: "Carlos A. M. dos Santos" <unixmania@gmail.com> Notes: svn path=/head/; revision=217119
* - Show textual representation of ioctl command in warning messageStanislav Sedov2011-01-061-2/+7
| | | | | | | | | | if ioctl(4) is failed besides the command number. Suggested by: delphij MFC after: 2 weeks Notes: svn path=/head/; revision=217046
* Remove dead assignments, we overwrite the variable almost immediately.Gavin Atkinson2010-06-192-3/+0
| | | | | | | Found by: clang static analyzer Notes: svn path=/head/; revision=209343
* mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to theUlrich Spörlein2010-05-131-2/+2
| | | | | | | | | | | | | | bottom of the manpages and order them consistently. GNU groff doesn't care about the ordering, and doesn't even mention CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put them. Found by: mdocml lint run Reviewed by: ru Notes: svn path=/head/; revision=208027
* The last big commit: let usr.sbin/ use WARNS=6 by default.Ed Schouten2010-01-021-2/+0
| | | | Notes: svn path=/head/; revision=201390
* ANSIfy almost all applications that use WARNS=6.Ed Schouten2009-12-291-1/+1
| | | | | | | | | | I was considering committing all these patches one by one, but as discussed with brooks@, there is no need to do this. If we ever need/want to merge these changes back, it is still possible to do this per application. Notes: svn path=/head/; revision=201227
* (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.Antoine Brodin2009-12-281-1/+1
| | | | | | | | | | | | Fix some wrong usages. Note: this does not affect generated binaries as this argument is not used. PR: 137213 Submitted by: Eygene Ryabinkin (initial version) MFC after: 1 month Notes: svn path=/head/; revision=201145
* - Add support to atomically set/clear individual bits of a MSR registerStanislav Sedov2009-06-302-25/+136
| | | | | | | | | | | | | | | | | | | | | | via cpuctl(4) driver. Two new CPUCTL_MSRSBIT and CPUCTL_MSRCBIT ioctl(2) calls treat the data field of the argument struct passed as a mask and set/clear bits of the MSR register according to the mask value. - Allow user to perform atomic bitwise AND and OR operaions on MSR registers via cpucontrol(8) utility. Two new operations ("&=" and "|=") have been added. The first one applies bitwise AND operaion between the current contents of the MSR register and the mask, and the second performs bitwise OR. The argument can be optionally prefixed with "~" inversion operator. This allows one to mimic the "clear bit" behavior by using the command like this: cpucontrol -m 0x10&=~0x02 # clear the second bit of TSC MSR Inversion operator support in all modes (assignment, OR, AND). Approved by: re (kib) MFC after: 1 month Notes: svn path=/head/; revision=195189
* Correct the information about when the respective functionality firstChristian Brueffer2009-04-231-1/+1
| | | | | | | | | | | appeared in FreeBSD. PR: 133785 Submitted by: Ulrich Spoerlein <uqs@spoerlein.net> MFC after: 3 days Notes: svn path=/head/; revision=191414