Skip to content

Conversation

pmenzel
Copy link
Collaborator

@pmenzel pmenzel commented Jun 28, 2017

$ sudo bee update linux-firmware # includes microcode updates for AMD processors
$ sudo bee install intel-microcode

To load the microcode updates automatically, they have to be present in initramfs. Here is, how to do it manually.

For example on keineahnung.

$ grep -E 'model|stepping|code' /proc/cpuinfo | sort -u
microcode	: 0x7c
model		: 94
model name	: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
stepping	: 3
$ echo 1 | sudo tee /sys/devices/system/cpu/microcode/reload
1
$ grep -E 'model|stepping|code' /proc/cpuinfo | sort -u
microcode	: 0xba
model		: 94
model name	: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
stepping	: 3
$ dmesg | grep microcode
[    2.353991] microcode: sig=0x506e3, pf=0x2, revision=0x7c
[    2.354545] microcode: Microcode Update Driver: v2.01 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
[ 1571.696669] microcode: updated to revision 0xba, date = 2017-04-09

On hmmjaeeh with the new microcode, the Linux Kernel even enables PEBS (Precise Event Based Sampling).

$ grep -E 'model|stepping|code' /proc/cpuinfo | sort -u
microcode	: 0x18
model		: 42
model name	: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
stepping	: 7
$ echo 1 | sudo tee /sys/devices/system/cpu/microcode/reload
1
$ grep -E 'model|stepping|code' /proc/cpuinfo | sort -u
microcode	: 0x29
model		: 42
model name	: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
stepping	: 7
$ dmesg | grep microcode
[    0.040558] core: PEBS disabled due to CPU errata, please upgrade microcode
[    2.676143] microcode: sig=0x206a7, pf=0x2, revision=0x18
[    2.677982] microcode: Microcode Update Driver: v2.01 <tigran@aivazian.fsnet.co.uk>, Peter Oruba
[ 1791.637454] microcode: updated to revision 0x29, date = 2013-06-12
[ 1791.638338] core: PEBS enabled due to microcode update

With the latest initramfs changes, the microcode updates are loaded early.

$ dmesg -T | grep microcode
[Fri Jun 30 17:31:33 2017] microcode: microcode updated early to revision 0xba, date = 2017-04-09
[Fri Jun 30 17:31:35 2017] microcode: sig=0x506e3, pf=0x2, revision=0xba
[Fri Jun 30 17:31:35 2017] microcode: Microcode Update Driver: v2.2.

> This package contains microcode patches for all AMD AMD64
> processors.  AMD releases microcode patches to correct
> processor behavior as documented in the respective processor
> revision guides.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/amd-ucode
> This package contains updated system processor microcode for
> Intel i686 and Intel X86-64 processors.  Intel releases microcode
> updates to correct processor behavior as documented in the
> respective processor specification updates.

Download the archive from [1].

The Linux module will load the file. It’s recommended to do that in
initramfs.

From *[WARNING] Intel Skylake/Kaby Lake processors: broken
hyper-threading* [2]:

> Skylake:
>
> If your processor model (listed in /proc/cpuinfo) is 78 or 94, and
> the stepping is 3, install the non-free "intel-microcode" package
> with base version 3.20170511.1, and reboot the system.  THIS IS
> THE RECOMMENDED SOLUTION FOR THESE SYSTEMS, AS IT FIXES OTHER
> PROCESSOR ISSUES AS WELL.

[1] https://downloadcenter.intel.com/search?keyword=linux+microcode
[2] #420
@pmenzel pmenzel force-pushed the add-microcode-updates-for-amd-and-intel-processors-and-update-to-latest-linux-firmware branch from 0a58927 to e63984e Compare June 28, 2017 08:54
@pmenzel pmenzel changed the title [Please test] Add microcode updates for amd and intel processors and update to latest linux firmware Add microcode updates for AMD and Intel processors and update to latest Linux firmware Jun 30, 2017
@wwwutz
Copy link
Collaborator

wwwutz commented Jul 3, 2017

is there any mechanism to prevent split brain between initramfs/lib/firmware and deinemuddah:/lib/firmware so if someone updates linux-firmware.be0 the other /project/admin/initramfs/lib/firmware get's synced ?

@pmenzel
Copy link
Collaborator Author

pmenzel commented Jul 3, 2017 via email

@wwwutz
Copy link
Collaborator

wwwutz commented Jul 3, 2017

ok, since only microcode blobs are in initramfs/lib/firmware that's ok for me. I was distracted by a temporary bnx2 tree.

good work 8-)

@pmenzel
Copy link
Collaborator Author

pmenzel commented Jul 3, 2017

Yeah, I removed all firmware files from the initramfs again. Sorry for the confusion.

project/admin/initramfs> sudo rm -rf lib/firmware/*

@wwwutz
Copy link
Collaborator

wwwutz commented Jul 3, 2017

chuck

@wwwutz wwwutz closed this Jul 3, 2017
@wwwutz wwwutz reopened this Jul 3, 2017
@wwwutz wwwutz merged commit 5ee4477 into master Jul 3, 2017
@donald donald deleted the add-microcode-updates-for-amd-and-intel-processors-and-update-to-latest-linux-firmware branch July 9, 2017 20:53
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants