FS#42354 - [grub] requires changes for ucode loading
Attached to Project:
Arch Linux
Opened by Christian Hesse (eworm) - Monday, 13 October 2014, 10:58 GMT
Last edited by Ronald van Haren (pressh) - Monday, 10 November 2014, 15:30 GMT
Opened by Christian Hesse (eworm) - Monday, 13 October 2014, 10:58 GMT
Last edited by Ronald van Haren (pressh) - Monday, 10 November 2014, 15:30 GMT
|
Details
Description:
Starting with latest linux and intel-ucode packages Intel microcode needs to be loaded early [0]. Grub has to handle this. I have created a simple patch that works for me, though this may have some rough edges. [0] https://lists.archlinux.org/pipermail/arch-dev-public/2014-October/026690.html Additional info: linux 3.17-2 intel-ucode 20140913-1 grub 1:2.02.beta2-4 |
This task depends upon
Closed by Ronald van Haren (pressh)
Monday, 10 November 2014, 15:30 GMT
Reason for closing: Implemented
Additional comments about closing: 1:2.02.beta2-5
Monday, 10 November 2014, 15:30 GMT
Reason for closing: Implemented
Additional comments about closing: 1:2.02.beta2-5
# grub-mkconfig -o /boot/grub/grub.cfg
[…]
Found Intel Microcode image
Linux-Abbild gefunden: /boot/vmlinuz-linux
initrd-Abbild gefunden: /boot/initramfs-linux.img
Found fallback initramfs image: /boot/initramfs-linux-fallback.img
After reboot:
# journalctl -b | grep early
Okt 23 00:47:28 zbox kernel: CPU0 microcode updated early to revision 0x1b, date = 2014-05-29
Okt 23 00:47:28 zbox kernel: CPU1 microcode updated early to revision 0x1b, date = 2014-05-29
Thinking about this... I have in mind that a single initramfs file can contain more than one cpio image. Can not find the documentation about that, though. Anybody with a hint? :D
Possibly we can make mkinicpio write the needed microcode and padding, then create the "real" initramfs appended to that.
https://www.kernel.org/doc/Documentation/x86/early-microcode.txt
Not sure if it suits our needs or if it is too late already.
# lsinitcpio /boot/intel-ucode.img
kernel/x86/microcode/GenuineIntel.bin
Possibly we should leave all boot loaders as-is and change mkinitcpio to concatenate the Intel and/or AMD microcode image and the generated initramfs. Will test this...
# cat /boot/intel-ucode.img /boot/initramfs-linux.img > /boot/ucode-initramfs-linux.img
Then make grub boot the new file (ucode-initramfs-linux.img) instead of the default one. Works perfectly for me, microcode is successfully updated to 0x1b. (I do not have a CPU that makes the kernel crash, though.) Anybody else wants to try?
$ dmesg|grep microcode
[ 0.000000] CPU0 microcode updated early to revision 0xa0b, date = 2010-09-28
[ 0.006666] CPU1 microcode updated early to revision 0xa0b, date = 2010-09-28
About the patch: I don't use grub-mkconfig, I always manually changed my grub.cfg, generated by the grub1→grub2 converter (I just never got used to grub2's syntax).
I think this will only see kernel/x86/microcode/GenuineIntel.bin and not the main initial ramdisk file.
kernel/x86/microcode/GenuineIntel.bin
It only reads the first archive. So we need some changes to lsinitcpio as well...
Huh? Clearly the "right" solution is to put the GenuineIntel.bin file to the right location in our main initramfs image, instead of concatenation tricks or loading multiple initrd images.
Tested that, does not work... Or can you prove it works?
Oh :( Sorry.
Is it deliberately made that way, or perhaps just a bug in the early microcode loading?