Handling of amd u-code
by 3rensho from LinuxQuestions.org on (#5EMRN)
Starting with kernel-5.10.xx (running 5.11.1 presently) every couple of days I get an error like the following in the system log -
Code:kernel mce: [Hardware Error]: CPU 0: Machine Check: 0 Bank 2: 9c254010000a0145
kernel mce: [Hardware Error]: TSC 0 ADDR 2c0 MISC c008001c00000000
kernel mce: [Hardware Error]: PROCESSOR 2:600f20 TIME 1614231277 SOCKET 0 APIC 0 microcode 6000822
kernel mce: [Hardware Error]: CPU 0: Machine Check: 0 Bank 2: dc25408000040136
kernel mce: [Hardware Error]: TSC 0 ADDR 2b763fb38 MISC c008001b00000000
kernel mce: [Hardware Error]: PROCESSOR 2:600f20 TIME 1614228656 SOCKET 0 APIC 0 microcode 6000822Never happened with earlier kernel versions. Doesn't seem to cause any problems and occurs only when system is just idling with only normal background processes running. Not under heavy load and not every day. I am running an AMD FX-9590 cpu. Doing some searches revealed that some AMD FX series processors are prone to these errors. Got to thinking that it could be a cpu u-code issue. Seems like the u-code is updated these days via the kernel firmware and mine is up to date as evidenced by entries in /lib/firmware/amd-ucode from 22.2.21.
Code:-rw-r--r-- 1 root root 12684 Feb 22 05:50 microcode_amd.bin
-rw-r--r-- 1 root root 490 Feb 22 05:50 microcode_amd.bin.asc
-rw-r--r-- 1 root root 7876 Feb 22 05:50 microcode_amd_fam15h.bin
-rw-r--r-- 1 root root 473 Feb 22 05:50 microcode_amd_fam15h.bin.asc
-rw-r--r-- 1 root root 3510 Feb 22 05:50 microcode_amd_fam16h.bin
-rw-r--r-- 1 root root 473 Feb 22 05:50 microcode_amd_fam16h.bin.asc
-rw-r--r-- 1 root root 6476 Feb 22 05:50 microcode_amd_fam17h.bin
-rw-r--r-- 1 root root 488 Feb 22 05:50 microcode_amd_fam17h.bin.asc
I would like to know how and when cpu microcode is actually loaded. When booting, the very early output says it is loading amd ucode 6000822 for each of the eight cores. That has never changed in the last several years so I am wondering if the new ucode from the firmware is being loaded at all?? How to tell???
Found an old entry in my /boot directory from 1999 named amd-ucode.cpio. It apparently never gets updated. Searched and found a script to generate a new one, did so but still these occasional errors continue. Not sure /boot/amd-ucode.cpio is ever read.
So now, after that I have a couple of questions as I am thoroughly confused.
How,when and if cpu u-code is updated. If it is how to determine actual version?
Thanks in advance for any clarification after this long winded question.


Code:kernel mce: [Hardware Error]: CPU 0: Machine Check: 0 Bank 2: 9c254010000a0145
kernel mce: [Hardware Error]: TSC 0 ADDR 2c0 MISC c008001c00000000
kernel mce: [Hardware Error]: PROCESSOR 2:600f20 TIME 1614231277 SOCKET 0 APIC 0 microcode 6000822
kernel mce: [Hardware Error]: CPU 0: Machine Check: 0 Bank 2: dc25408000040136
kernel mce: [Hardware Error]: TSC 0 ADDR 2b763fb38 MISC c008001b00000000
kernel mce: [Hardware Error]: PROCESSOR 2:600f20 TIME 1614228656 SOCKET 0 APIC 0 microcode 6000822Never happened with earlier kernel versions. Doesn't seem to cause any problems and occurs only when system is just idling with only normal background processes running. Not under heavy load and not every day. I am running an AMD FX-9590 cpu. Doing some searches revealed that some AMD FX series processors are prone to these errors. Got to thinking that it could be a cpu u-code issue. Seems like the u-code is updated these days via the kernel firmware and mine is up to date as evidenced by entries in /lib/firmware/amd-ucode from 22.2.21.
Code:-rw-r--r-- 1 root root 12684 Feb 22 05:50 microcode_amd.bin
-rw-r--r-- 1 root root 490 Feb 22 05:50 microcode_amd.bin.asc
-rw-r--r-- 1 root root 7876 Feb 22 05:50 microcode_amd_fam15h.bin
-rw-r--r-- 1 root root 473 Feb 22 05:50 microcode_amd_fam15h.bin.asc
-rw-r--r-- 1 root root 3510 Feb 22 05:50 microcode_amd_fam16h.bin
-rw-r--r-- 1 root root 473 Feb 22 05:50 microcode_amd_fam16h.bin.asc
-rw-r--r-- 1 root root 6476 Feb 22 05:50 microcode_amd_fam17h.bin
-rw-r--r-- 1 root root 488 Feb 22 05:50 microcode_amd_fam17h.bin.asc
I would like to know how and when cpu microcode is actually loaded. When booting, the very early output says it is loading amd ucode 6000822 for each of the eight cores. That has never changed in the last several years so I am wondering if the new ucode from the firmware is being loaded at all?? How to tell???
Found an old entry in my /boot directory from 1999 named amd-ucode.cpio. It apparently never gets updated. Searched and found a script to generate a new one, did so but still these occasional errors continue. Not sure /boot/amd-ucode.cpio is ever read.
So now, after that I have a couple of questions as I am thoroughly confused.
How,when and if cpu u-code is updated. If it is how to determine actual version?
Thanks in advance for any clarification after this long winded question.