clearlinux / distribution

Placeholder repository to allow filing of general bugs/issues/etc against the Clear Linux OS for Intel Architecture linux distribution
521 stars 29 forks source link

Attempting late microcode loading #2899

Open bwarden opened 1 year ago

bwarden commented 1 year ago
          I'm still getting
May 20 18:47:02 9940x systemd[1]: Starting clr-power.service...
May 20 18:47:02 9940x kernel: microcode: Attempting late microcode loading - it is dangerous and taints the kernel.
May 20 18:47:02 9940x kernel: microcode: You should switch to early loading, if possible.
May 20 18:47:02 9940x kernel: microcode: updated to revision 0x2006f05, date = 2022-12-21
May 20 18:47:02 9940x kernel: microcode: Reload succeeded, microcode revision: 0x2006e05 -> 0x2006f05
May 20 18:47:02 9940x systemd[1]: clr-power.service: Deactivated successfully.

I'm on version 39150, but I've been seeing this for a while.

> sudo dmesg | grep microcode
[    0.000000] microcode: updated early: 0x200004d -> 0x2006e05, date = 2022-03-08
[    0.929601] calling  save_microcode_in_initrd+0x0/0xc0 @ 1
[    0.933678] initcall save_microcode_in_initrd+0x0/0xc0 returned 0 after 4000 usecs
[    1.187968] calling  microcode_init+0x0/0x1c0 @ 1
[    1.188133] microcode: Microcode Update Driver: v2.2.
[    1.188135] initcall microcode_init+0x0/0x1c0 returned 0 after 165 usecs
[   40.301720] microcode: Attempting late microcode loading - it is dangerous and taints the kernel.
[   40.310606] microcode: You should switch to early loading, if possible.
[   40.323664] microcode: updated to revision 0x2006f05, date = 2022-12-21
[   40.323709] microcode: Reload succeeded, microcode revision: 0x2006e05 -> 0x2006f05

so it looks like it's early loading to 2022-03-8, and then late loading to 2022-12-21?

Originally posted by @chriselrod in https://github.com/clearlinux/clr-boot-manager/issues/252#issuecomment-1556057136

sebastiencs commented 1 year ago

I'm getting the same behavior where it's updated both early and late:

# dmesg | ag microcode
[    0.000000] microcode: updated early: 0x423 -> 0x429, date = 2023-01-11
[    3.144867] microcode: Microcode Update Driver: v2.2.
[   29.799317] microcode: Attempting late microcode loading - it is dangerous and taints the kernel.
[   29.800981] microcode: You should switch to early loading, if possible.
[   29.808869] microcode: updated to revision 0x42a, date = 2023-02-14
[   29.814867] microcode: Reload succeeded, microcode revision: 0x429 -> 0x42a
bwarden commented 1 year ago

Let's see what's going on: cat /proc/cmdline ls -l /usr/lib/initrd.d /etc/kernel/initrd.d/

bwarden commented 1 year ago

Also sudo systemctl start boot.mount && sudo ls -l /boot/EFI/org.clearlinux/ && sudo systemctl stop boot.mount to double-check that the initrd was properly installed.

sebastiencs commented 1 year ago

@bwarden

# cat /proc/cmdline
initrd=\EFI\org.clearlinux\freestanding-00-early-ucode.cpio initrd=\EFI\org.clearlinux\initrd-org.clearlinux.native.6.3.2-1312 initrd=\EFI\org.clearlinux\freestanding-clr-init.cpio.gz initrd=\EFI\org.clearlinux\freestanding-my_initrd.cpio.gz initrd=\EFI\org.clearlinux\freestanding-i915-firmware.cpio.xz [non-inirtd-params...]
# ls -l /usr/lib/initrd.d /etc/kernel/initrd.d/
/etc/kernel/initrd.d/:
total 712
-rw-r--r-- 1 root root 728459 Aug 27  2022 my_initrd.cpio.gz

/usr/lib/initrd.d:
total 39932
-rw-r--r-- 1 root root 12716544 May 17 16:59 00-early-ucode.cpio
-rw-r--r-- 1 root root 25534403 Dec 11  2021 clr-init.cpio.gz
-rw-r--r-- 1 root root  2591320 Feb  2  2019 i915-firmware.cpio.xz
$ sudo systemctl start boot.mount && sudo ls -l /boot/EFI/org.clearlinux/ && sudo systemctl stop boot.mount
total 83164
-rwx------ 1 root root  1202593 Feb  1 14:29 bootloaderx64.efi
-rwx------ 1 root root 12151296 Apr  5 16:42 freestanding-00-early-ucode.cpio
-rwx------ 1 root root 25534403 May 28  2022 freestanding-clr-init.cpio.gz
-rwx------ 1 root root  2492796 Apr  5 16:42 freestanding-i915-firmware.cpio.xz
-rwx------ 1 root root   728459 Aug 27  2022 freestanding-my_initrd.cpio.gz
-rwx------ 1 root root   100708 May  8 17:50 initrd-org.clearlinux.native.6.3.1-1311
-rwx------ 1 root root   100772 May 12 20:54 initrd-org.clearlinux.native.6.3.2-1312
-rwx------ 1 root root 11335360 Apr 27 14:53 kernel-org.clearlinux.lts2020.5.10.179-110
-rwx------ 1 root root 15671968 May  8 17:50 kernel-org.clearlinux.native.6.3.1-1311
-rwx------ 1 root root 15676960 May 12 20:54 kernel-org.clearlinux.native.6.3.2-1312
-rwx------ 1 root root   144859 Feb  1 14:29 loaderx64.efi

Let me know if you need more informations

bwarden commented 1 year ago

OK, you have an older microcode cpio in /boot. That should have been handled by clr-boot-manager automatically, but let's try to update it manually: sudo clr-boot-manager update

Then check again to see if the copy in /boot matches the copy in /usr/lib/initrd.d

sebastiencs commented 1 year ago

Yes after running sudo clr-boot-manager update, /boot/EFI/org.clearlinux/freestanding-00-early-ucode.cpio was updated and now there is no more late microcode loading:

$ sudo dmesg | ag microcode
[    0.000000] microcode: updated early: 0x423 -> 0x42a, date = 2023-02-14
[    6.484194] microcode: Microcode Update Driver: v2.2.

Not sure why it was not updated automatically

chriselrod commented 1 year ago

sudo clr-boot-manager update also seems to have worked for me.

I installed clear linux on two systems a couple months ago that experienced this problem. So the install was more recent than the microcode versions.