X86/64 uses "dangerous" late microcode loading

I'm wondering if there is a use-case to keep this method of providing microcode updates in play? Upstream deprecated this method years ago.

# dmesg|grep micro
[    1.811137] Register File Data Sampling: Vulnerable: No microcode
[    3.662993] microcode: Microcode Update Driver: v2.2.
[    4.576363] microcode: Attempting late microcode loading - it is dangerous and taints the kernel.
[    4.585328] microcode: You should switch to early loading, if possible.
[    4.595459] microcode: updated to revision 0x17, date = 2023-12-07
[    4.602552] microcode: Reload succeeded, microcode revision: 0xe -> 0x17

It applies only to "caveat" microcode that is usually thrown in initrd.

1 Like

Support was there for one day.

1 Like

Nice find @brada4 - no reason given for revert

But at least gives the idea what to do.

1 Like

I agree, just wondering if there was some deleterious effects from enabling it.

Tagging: @blogic

2 Likes

https://lists.openwrt.org/pipermail/openwrt-devel/2018-November/020431.html

Seems steps have been taken since:

Ping @tmn505 for feedback.

Nice find @dave14305 - it seems the issue in keeping this back in 2018 was on a sysupgrade, grub would not get updated and thus fail due to the missing test module. It seems that that module has been added in early 2023 with bdd78897c33b25a4954f6e41e26f57bab5284129

I wonder if that is sufficient time to assume it is present and allow the early loading code to be merged.

I created a draft PR due to the fact that /boot/amd-ucode.img that it creates doesn't actually update on my test machine whereas replacing it with the version built in the Arch Linux amd-ucode package does. If anyone has any insights, I am interested to here them!

I don’t know anything about how the image file is supposed to be created, but I’m puzzled a bit by the concatenation of all the files. My only other reference for such an initrd is here:

Edit: I see the same approach used in the Arch Linux build, so maybe I’m not helping here. :thinking:

Edit2: what directory structure ends up inside the archive? Does it need to be /lib/firmware/ inside?