Add support for microcode update on newer AMD CPUs (10h+)
authoravg <avg@FreeBSD.org>
Wed, 2 Nov 2016 16:15:49 +0000 (16:15 +0000)
committeravg <avg@FreeBSD.org>
Wed, 2 Nov 2016 16:15:49 +0000 (16:15 +0000)
commit34fc8742e20c142bd5fa7f41ce374a0b9e8b0adf
tree5e4c781eb712530ea14f2ed795be9d9df4bd8c46
parent808cc562ebdd9405dd036f1e395516bb663a6264
Add support for microcode update on newer AMD CPUs (10h+)

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
sys/dev/cpuctl/cpuctl.c
usr.sbin/cpucontrol/Makefile
usr.sbin/cpucontrol/amd.h
usr.sbin/cpucontrol/amd10h.c [new file with mode: 0644]
usr.sbin/cpucontrol/cpucontrol.c