CPU microcode not updated during boot

Hi,
this is a not that recent Lenovo Xeon 2276M laptop. Some time ago, I do remember, that dmesg showed some updates regarding the microcode. But now, there's just "no matching update found". Please see the logs below. I assume those microcode updates cannot be persistent and they need to be uploaded to the CPU each time a machine boots. Could anybody elaborate on that please? Do UEFI firmware updates as they come from Lenovo affect this?

Code:
jb@p1 ~> doas dmesg | grep -i micro
CPU microcode: no matching update found

jb@p1 ~> cat /boot/loader.conf | grep -i microco
# CPU microcode update
cpu_microcode_load="YES"
cpu_microcode_name="/boot/firmware/intel-ucode.bin"

jb@p1 ~> freebsd-version -kru
14.1-RELEASE-p5
14.1-RELEASE-p5
14.1-RELEASE-p6
 
Do UEFI firmware updates as they come from Lenovo affect this?
100% sure of course.
UEFI firmware updates can (not in all updates, though) contain microcode updates. And if the microcode in the UEFI firmware of the computer is same or newer than the ones FreeBSD ports has, no matching microcodes (mean, applicable updates) can be found, thus, the message is shown.

For example, in the Version Information section of document "BIOS Update CD (ISO image file for bootable CD)" for N2CUR42W, in the descriptions for N2CUR39W, a line
Code:
- (New) Updated the CPU microcode.
can be seen among others.
 
I have been running into this issue on an AMD ryzen zen1 system (Ryzen 5 2600) for a few months now as well. I have the following in my /boot/loader.conf too:

Code:
cpu_microcode_load="YES"
cpu_microcode_name="/boot/firmware/amd-ucode.bin"

I can also confirm that the amd-ucode.bin file exists and that it did work at one point. Could this be a recent regression?
 
I have been running into this issue on an AMD ryzen zen1 system (Ryzen 5 2600) for a few months now as well. I have the following in my /boot/loader.conf too:

Code:
cpu_microcode_load="YES"
cpu_microcode_name="/boot/firmware/amd-ucode.bin"

I can also confirm that the amd-ucode.bin file exists and that it did work at one point. Could this be a recent regression?
Are you 100% sure your UEFI firmware / BIOS does NOT have the SAME OR NEWER microcode that are provided by sysutils/cpu-microcode-amd?

If your microcode in your UEFI firmware / BIOS is OLDER than the ones provided by sysutils/cpu-microcode-amd, something is NOT working properly on FreeBSD side. Please file a bug on bugzilla.

But if not (for example, you've upgraded your UEFI firmware / BIOS AFTER the last time you confirmed that your microcode is updated by FreeBSD, the update would have the same or newer microcode as sysutils/cpu-microcode-amd.

In this case, COMPLETELY NO PROBLEM ON FreeBSD.
You can confirm your microcode version by installing sysutils/x86info and run x86info -a | grep Microcode as root. Sorry, I don't have AMD CPU to test, so I cannot guarantee that it works correct for you or not.
 
Code:
CPU: AMD Athlon 5350 APU with Radeon R3 (4) @ 2.046GHz
# x86info -a | grep Microcode
Bash:
/dev/cpuctl0: No such file or directory
/dev/cpuctl0: No such file or directory
What is this?
 
Yes!
Bash:
The most recent versions of packages are already installed
Maybe that...
Bash:
AMD systems running FreeBSD prior to 2024-02-22 snapshot
34467bd76 only support late loading.
 
Code:
CPU: AMD Athlon 5350 APU with Radeon R3 (4) @ 2.046GHz
# x86info -a | grep Microcode
Bash:
/dev/cpuctl0: No such file or directory
/dev/cpuctl0: No such file or directory
What is this?
It means you've not loaded kernel module cpuctl(4).

I think cpu_microcode_load="YES" in /boot/loader.conf with proper cpu_microcode_name= setting ("/boot/firmware/intel-ucode.bin" for Inte and "/boot/firmware/amd-ucode.bin" for AMD) automatically load it, but not 100% sure as I have cpuctl_load="YES" in my /boot/loader.conf with some historical reason.

If you don't see cpuctl.ko within the output of kldstat(8), try adding cpuctl_load="YES" in your /boot/loader.conf.
 
Yes!
Bash:
The most recent versions of packages are already installed
Maybe that...
Bash:
AMD systems running FreeBSD prior to 2024-02-22 snapshot
34467bd76 only support late loading.
Tracked commit logs on stable/14 but unfortunately cannot find the relevant commit MFC'ed.
So early loading on AMD CPUs are supported only on main (aka 15-Current) for now. And as I don't have computer to test with AMD CPUs, cannot try cherry-picking the commit and test.
 
Thank you, T-Aoki, it worked. Interesting, but the module (cpuctl) was already loaded from somewhere (kldstat). Although the module was NOT EXPLICITLY registered in /boot/loader.conf. But following your instructions, I EXPLICITLY registered the module
Code:
cpuctl_load="YES"
than rebooted and the output was this:
# x86info -a | grep Microcode
Bash:
Microcode patch level: 0x700010b
 
x86info removed from ports. Is any other way to see the microcode version?
sysutils/cpupdate has option to show it.

Code:
# sysctl -a | grep microcode     
CPU microcode: updated from 0xf6 to 0xfa
CPU microcode: updated from 0xf6 to 0xfa
CPU microcode: updated from 0xf6 to 0xfa
CPU microcode: updated from 0xf6 to 0xfa

# cpupdate -i
Found CPU(s) from Intel
Core 0 to 11: CPUID: 906ea  Fam 06  Mod 9e  Step 0a  Flag 20 uCode 000000fa
#
 
Back
Top