Skip to contentSkip to conversation

x86/intel: Refresh the old ucode revisions with a script

PATCH In review Sohil Mehta 5 participants 22 messages Aug 18, 2025 – Nov 26, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover x86/intel: Refresh the old ucode revisions with a script

The kernel maintains a list of recently released Intel microcode revisions for each family-model-stepping. Systems with microcode older than those listed are marked with X86_BUG_OLD_MICROCODE [1].

Naturally, the microcode list needs to be periodically updated to reflect the latest releases. This series introduces a script to simplify this process along with the first update.

Microcode revision update (Patch 1)
-----------------------------------
The update is based on the May 2025 Intel microcode release [2]. Even if this is taken through the x86/urgent branch, a gap of 3 months seems like enough time for systems to have been updated. If there are concerns regarding the timing, the patch can be taken through the regular merge window.

It also includes a stable Cc to keep the stable trees up-to-date.

The update script (Patch 2)
---------------------------
Below is the help text for the script. Any feedback on the interface or the help text is appreciated.

$ ./scripts/update-intel-ucode-defs.py -h
usage: update-intel-ucode-defs.py [-h] -u UCODE_PATH [-o HEADER]

For Intel CPUs, update the microcode revisions that determine X86_BUG_OLD_MICROCODE.

The script takes the Intel microcode files as input and uses the iucode-tool to extract the revision information. It formats the output and writes it to intel-ucode-defs.h which holds the minimum expected revision for each family-model-stepping.

A typical usage is to get the desired release of the Intel Microcode Update Package at:
https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files.git

And run:
./scripts/update-intel-ucode-defs.py -u /path/to/microcode/files

Note: The microcode revisions are usually updated shortly after a new microcode package is released, allowing a reasonable time for systems to get the update.

options:
-h, --help show this help message and exit
-u UCODE_PATH, --ucode_path UCODE_PATH
Path to the microcode files
-o HEADER, --output HEADER
The microcode header file to be updated (default: intel-ucode-defs.h)

Links
-----
[1]: https://lore.kernel.org/lkml/174530444932.31282.15748299566756052894.tip-bot2@tip-bot2/
[2]: https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/releases/tag/microcode-20250512

Sohil Mehta (2):
x86/microcode/intel: Refresh the revisions that determine
old_microcode
scripts/x86: Add a script to update minimum Intel ucode revisions

 MAINTAINERS                                   |   1 +
 .../kernel/cpu/microcode/intel-ucode-defs.h   |  86 ++++++-----
 scripts/update-intel-ucode-defs.py            | 134 ++++++++++++++++++
 3 files changed, 183 insertions(+), 38 deletions(-)
 create mode 100755 scripts/update-intel-ucode-defs.py
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/2 x86/microcode/intel: Refresh the revisions that determine old_microcode

Update the minimum expected revisions of Intel microcode based on the microcode-20250512 (May 2025) release.

---
 .../kernel/cpu/microcode/intel-ucode-defs.h   | 86 +++++++++++--------
 1 file changed, 48 insertions(+), 38 deletions(-)
arch/x86/kernel/cpu/microcode/intel-ucode-defs.h +48 -38
index cb6e601701ab..2d48e6593540 100644
@@ -67,9 +67,8 @@
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0008, .driver_data = 0x1000191 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0010, .driver_data = 0x2007006 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0020, .driver_data = 0x3000010 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0040, .driver_data = 0x4003605 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0080, .driver_data = 0x5003707 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0800, .driver_data = 0x7002904 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0080, .driver_data = 0x5003901 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0800, .driver_data = 0x7002b01 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x56, .steppings = 0x0004, .driver_data = 0x1c },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x56, .steppings = 0x0008, .driver_data = 0x700001c },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x56, .steppings = 0x0010, .driver_data = 0xf00001a },
@@ -81,51 +80,62 @@
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x5f, .steppings = 0x0002, .driver_data = 0x3e },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x66, .steppings = 0x0008, .driver_data = 0x2a },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x6a, .steppings = 0x0020, .driver_data = 0xc0002f0 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x6a, .steppings = 0x0040, .driver_data = 0xd0003e7 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x6c, .steppings = 0x0002, .driver_data = 0x10002b0 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x6a, .steppings = 0x0040, .driver_data = 0xd000404 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x6c, .steppings = 0x0002, .driver_data = 0x10002d0 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x7a, .steppings = 0x0002, .driver_data = 0x42 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x7a, .steppings = 0x0100, .driver_data = 0x24 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x7e, .steppings = 0x0020, .driver_data = 0xc6 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x7a, .steppings = 0x0100, .driver_data = 0x26 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x7e, .steppings = 0x0020, .driver_data = 0xca },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8a, .steppings = 0x0002, .driver_data = 0x33 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8c, .steppings = 0x0002, .driver_data = 0xb8 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8c, .steppings = 0x0004, .driver_data = 0x38 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8d, .steppings = 0x0002, .driver_data = 0x52 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8c, .steppings = 0x0002, .driver_data = 0xbc },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8c, .steppings = 0x0004, .driver_data = 0x3c },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8d, .steppings = 0x0002, .driver_data = 0x56 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8e, .steppings = 0x0200, .driver_data = 0xf6 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8e, .steppings = 0x0400, .driver_data = 0xf6 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8e, .steppings = 0x0800, .driver_data = 0xf6 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8e, .steppings = 0x1000, .driver_data = 0xfc },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0100, .driver_data = 0x2c000390 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0080, .driver_data = 0x2b000603 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0040, .driver_data = 0x2c000390 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0020, .driver_data = 0x2c000390 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0010, .driver_data = 0x2c000390 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8e, .steppings = 0x1000, .driver_data = 0x100 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0010, .driver_data = 0x2c0003f7 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0020, .driver_data = 0x2c0003f7 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0040, .driver_data = 0x2c0003f7 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0080, .driver_data = 0x2b000639 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0100, .driver_data = 0x2c0003f7 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x96, .steppings = 0x0002, .driver_data = 0x1a },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x97, .steppings = 0x0004, .driver_data = 0x37 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x97, .steppings = 0x0020, .driver_data = 0x37 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xbf, .steppings = 0x0004, .driver_data = 0x37 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xbf, .steppings = 0x0020, .driver_data = 0x37 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9a, .steppings = 0x0008, .driver_data = 0x435 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9a, .steppings = 0x0010, .driver_data = 0x435 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x97, .steppings = 0x0004, .driver_data = 0x3a },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x97, .steppings = 0x0020, .driver_data = 0x3a },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9a, .steppings = 0x0008, .driver_data = 0x437 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9a, .steppings = 0x0010, .driver_data = 0x437 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9c, .steppings = 0x0001, .driver_data = 0x24000026 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9e, .steppings = 0x0200, .driver_data = 0xf8 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9e, .steppings = 0x0400, .driver_data = 0xf8 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9e, .steppings = 0x0400, .driver_data = 0xfa },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9e, .steppings = 0x0800, .driver_data = 0xf6 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9e, .steppings = 0x1000, .driver_data = 0xf8 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9e, .steppings = 0x2000, .driver_data = 0x100 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa5, .steppings = 0x0004, .driver_data = 0xfc },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa5, .steppings = 0x0008, .driver_data = 0xfc },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa5, .steppings = 0x0020, .driver_data = 0xfc },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa6, .steppings = 0x0001, .driver_data = 0xfe },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa6, .steppings = 0x0002, .driver_data = 0xfc },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa7, .steppings = 0x0002, .driver_data = 0x62 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xaa, .steppings = 0x0010, .driver_data = 0x20 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xb7, .steppings = 0x0002, .driver_data = 0x12b },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xba, .steppings = 0x0004, .driver_data = 0x4123 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xba, .steppings = 0x0008, .driver_data = 0x4123 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xba, .steppings = 0x0100, .driver_data = 0x4123 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xbe, .steppings = 0x0001, .driver_data = 0x1a },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xcf, .steppings = 0x0004, .driver_data = 0x21000283 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xcf, .steppings = 0x0002, .driver_data = 0x21000283 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x9e, .steppings = 0x2000, .driver_data = 0x104 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa5, .steppings = 0x0004, .driver_data = 0x100 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa5, .steppings = 0x0008, .driver_data = 0x100 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa5, .steppings = 0x0020, .driver_data = 0x100 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa6, .steppings = 0x0001, .driver_data = 0x102 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa6, .steppings = 0x0002, .driver_data = 0x100 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xa7, .steppings = 0x0002, .driver_data = 0x64 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xaa, .steppings = 0x0010, .driver_data = 0x24 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xad, .steppings = 0x0002, .driver_data = 0xa0000d1 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xaf, .steppings = 0x0008, .driver_data = 0x3000341 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xb5, .steppings = 0x0001, .driver_data = 0xa },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xb7, .steppings = 0x0002, .driver_data = 0x12f },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xb7, .steppings = 0x0010, .driver_data = 0x12f },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xba, .steppings = 0x0004, .driver_data = 0x4128 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xba, .steppings = 0x0008, .driver_data = 0x4128 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xba, .steppings = 0x0100, .driver_data = 0x4128 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xbd, .steppings = 0x0002, .driver_data = 0x11f },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xbe, .steppings = 0x0001, .driver_data = 0x1d },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xbf, .steppings = 0x0004, .driver_data = 0x3a },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xbf, .steppings = 0x0020, .driver_data = 0x3a },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xbf, .steppings = 0x0040, .driver_data = 0x3a },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xbf, .steppings = 0x0080, .driver_data = 0x3a },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xc5, .steppings = 0x0004, .driver_data = 0x118 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xc6, .steppings = 0x0004, .driver_data = 0x118 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xc6, .steppings = 0x0010, .driver_data = 0x118 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xca, .steppings = 0x0004, .driver_data = 0x118 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xcf, .steppings = 0x0002, .driver_data = 0x210002a9 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0xcf, .steppings = 0x0004, .driver_data = 0x210002a9 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0xf,  .model = 0x00, .steppings = 0x0080, .driver_data = 0x12 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0xf,  .model = 0x00, .steppings = 0x0400, .driver_data = 0x15 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0xf,  .model = 0x01, .steppings = 0x0004, .driver_data = 0x2e },
Signature · 1 line
2.43.0
reviewer
#2 lore raw

Re: [PATCH 1/2] x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 14 lines · Sohil Mehta

Update the minimum expected revisions of Intel microcode based on the microcode-20250512 (May 2025) release.

---
 .../kernel/cpu/microcode/intel-ucode-defs.h   | 86 +++++++++++--------
 1 file changed, 48 insertions(+), 38 deletions(-)
arch/x86/kernel/cpu/microcode/intel-ucode-defs.h +0 -0
index cb6e601701ab..2d48e6593540 100644

arch/x86/kernel/cpu/microcode/intel-ucode-defs.h line 70

Quoted 4 lines
arch/x86/kernel/cpu/microcode/intel-ucode-defs.h +0 -1
@@ -67,9 +67,8 @@
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0008, .driver_data = 0x1000191 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0010, .driver_data = 0x2007006 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0020, .driver_data = 0x3000010 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0040, .driver_data = 0x4003605 },

".model = 0x55, .steppings = 0x0040" is being removed? Total number of entries in the table are being reduced by ~10.

Quoted 8 lines
arch/x86/kernel/cpu/microcode/intel-ucode-defs.h +2 -2
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0080, .driver_data = 0x5003707 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0800, .driver_data = 0x7002904 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0080, .driver_data = 0x5003901 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0800, .driver_data = 0x7002b01 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x56, .steppings = 0x0004, .driver_data = 0x1c },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x56, .steppings = 0x0008, .driver_data = 0x700001c },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x56, .steppings = 0x0010, .driver_data = 0xf00001a },
@@ -81,51 +80,62 @@
#3 lore raw

Re: [PATCH 1/2] x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 10 lines · Pawan Gupta
Quoted 9 lines · Sohil Mehta

Update the minimum expected revisions of Intel microcode based on the microcode-20250512 (May 2025) release.

---
 .../kernel/cpu/microcode/intel-ucode-defs.h   | 86 +++++++++++--------
 1 file changed, 48 insertions(+), 38 deletions(-)
Quoted 11 lines

arch/x86/kernel/cpu/microcode/intel-ucode-defs.h line 70

Quoted 9 lines
arch/x86/kernel/cpu/microcode/intel-ucode-defs.h +0 -1
index cb6e601701ab..2d48e6593540 100644
@@ -67,9 +67,8 @@
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0008, .driver_data = 0x1000191 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0010, .driver_data = 0x2007006 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0020, .driver_data = 0x3000010 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0040, .driver_data = 0x4003605 },

".model = 0x55, .steppings = 0x0040" is being removed? Total number of entries in the table are being reduced by ~10.

That's because early in a CPUs lifecycle, microcode for the late pre-production steppings are still included in the public repo, but eventually dropped.

Alas, these deletions are documented as well as everything else is in the changelog...

~Andrew

#4 lore raw

Re: [PATCH 1/2] x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 5 lines · Andrew Cooper
Quoted 4 lines · Pawan Gupta
Quoted 3 lines · Sohil Mehta

Update the minimum expected revisions of Intel microcode based on the microcode-20250512 (May 2025) release.

Quoted 9 lines
Quoted 8 lines
Quoted 6 lines
---
 .../kernel/cpu/microcode/intel-ucode-defs.h   | 86 +++++++++++--------
 1 file changed, 48 insertions(+), 38 deletions(-)

".model = 0x55, .steppings = 0x0040" is being removed? Total number of entries in the table are being reduced by ~10.

Based on the diff stat, aren't the total entries increasing by 10?

Quoted 7 lines

That's because early in a CPUs lifecycle, microcode for the late pre-production steppings are still included in the public repo, but eventually dropped.

Alas, these deletions are documented as well as everything else is in the changelog...

I sorted the file by FMS to make it easier to spot changes going forward. Though, I don't think we can rely on the kernel history to track the microcode changes. Because there isn't a direct 1:1 mapping between the microcode releases and the kernel update. (Unless that's what you are proposing)

Dave's initial commit used the Nov 2024 release, and this one is based on May 2025. There could potentially be multiple releases in the middle that added and removed stuff which would go unnoticed. Though, using the script in patch 2 it should be easy to track that (outside the kernel) if really needed.

Quoted 1 line

~Andrew

reviewer
#5 lore raw

Re: [PATCH 1/2] x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 12 lines · Sohil Mehta
Quoted 11 lines · Andrew Cooper
Quoted 10 lines · Pawan Gupta
Quoted 9 lines · Sohil Mehta

Update the minimum expected revisions of Intel microcode based on the microcode-20250512 (May 2025) release.

---
 .../kernel/cpu/microcode/intel-ucode-defs.h   | 86 +++++++++++--------
 1 file changed, 48 insertions(+), 38 deletions(-)
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

".model = 0x55, .steppings = 0x0040" is being removed? Total number of entries in the table are being reduced by ~10.

Based on the diff stat, aren't the total entries increasing by 10?

Ya, sorry my bad.

reviewer
#6 lore raw

Re: [PATCH 1/2] x86/microcode/intel: Refresh the revisions that determine old_microcode

In reply to Andrew Cooper
Quoted 23 lines · Andrew Cooper
Quoted 10 lines · Pawan Gupta
Quoted 9 lines · Sohil Mehta

Update the minimum expected revisions of Intel microcode based on the microcode-20250512 (May 2025) release.

---
 .../kernel/cpu/microcode/intel-ucode-defs.h   | 86 +++++++++++--------
 1 file changed, 48 insertions(+), 38 deletions(-)
Quoted 11 lines

arch/x86/kernel/cpu/microcode/intel-ucode-defs.h line 70

Quoted 9 lines
arch/x86/kernel/cpu/microcode/intel-ucode-defs.h +0 -1
index cb6e601701ab..2d48e6593540 100644
@@ -67,9 +67,8 @@
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0008, .driver_data = 0x1000191 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0010, .driver_data = 0x2007006 },
 { .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0020, .driver_data = 0x3000010 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x55, .steppings = 0x0040, .driver_data = 0x4003605 },

".model = 0x55, .steppings = 0x0040" is being removed? Total number of entries in the table are being reduced by ~10.

Quoted 3 lines

That's because early in a CPUs lifecycle, microcode for the late pre-production steppings are still included in the public repo, but eventually dropped.

Sometimes Linux care about the pre-production steppings, other times we don't.

Quoted 2 lines

Alas, these deletions are documented as well as everything else is in the changelog...

Should this file reflect those deletions as well? As an example, if an ancient part gets removed from the microcode repo, it may still be worth for Linux to keep the record of its last microcode version.

#7 lore raw

Re: [PATCH 1/2] x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 5 lines · Pawan Gupta
Quoted 2 lines

Alas, these deletions are documented as well as everything else is in the changelog...

Should this file reflect those deletions as well? As an example, if an ancient part gets removed from the microcode repo, it may still be worth for Linux to keep the record of its last microcode version.

<sigh>

There's even a "Removed Platforms" section in the microcode repo changelogs that gets copied and pasted for each release. But it's not consistently updated as platforms are removed.

But, thanks to the magic of git, we can just look for the removed files:

06-55-06
06-cf-01
06-8f-05
06-8f-06
06-ba-08
06-8f-04
06-86-04
06-86-05

.. that never came back in a later version. It might be a fun exercise to run through those and see if any of them matter.

We could always reconstruct the .h file from *all* of the microcode repo's git history. It's just scripting. But we better be doing it for a real reason.

If folks have one of these preproduction CPUs, they've got much bigger problems that being warned about old microcode. If we think it's the kernel's job to tell folks about these, I'd rather it be some other mechanism than the old_microcode one.

For instance, we could make a x86_cpu_id[] that lists these and taints if they're ever seen.

So, let's just ignore this issue for now. I'm not convinced it's a practical problem.

#8 lore raw

Re: [PATCH 1/2] x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 8 lines · Dave Hansen
Quoted 5 lines · Pawan Gupta
Quoted 2 lines

Alas, these deletions are documented as well as everything else is in the changelog...

Should this file reflect those deletions as well? As an example, if an ancient part gets removed from the microcode repo, it may still be worth for Linux to keep the record of its last microcode version.

<sigh>

Quoted 7 lines

There's even a "Removed Platforms" section in the microcode repo changelogs that gets copied and pasted for each release. But it's not consistently updated as platforms are removed.

But, thanks to the magic of git, we can just look for the removed files:

06-55-06

CLX B0 stepping, notably gaining MSR_TSX_FORCE_ABORT rather than MSR_TSX_CTRL.  It was a giant muddle for mitigations.

Quoted 1 line

06-cf-01

EMR.  Stepping 2 still available.

Quoted 3 lines

06-8f-04
06-8f-05
06-8f-06

SPR.  Steppings 7 and 8 still available.

These are weird.  06-8f-08 has two blobs in it with disjoint platform flags (this is fine).

However, all 3 blobs between -07 and -08 all have sigtables covering everything back to stepping 4.

Arguably that's a bug for the intel form of the microcode (which is indexed on stepping), but it's just some extraneous metadata.  The rest of it is suggesting that SPR steppings 4-8 had compatible-enough microcode for them all to be patched by the same blob.

Quoted 1 line

06-ba-08

RPL. The repo has steppings 2 and 3, so I wonder what RPL stepping 8 is.

Quoted 2 lines

06-86-04
06-86-05

SNR.  All steppings dropped, although it's apparently a mobile basestation only, so I guess it's not running Linux.

~Andrew

#9 lore raw

Old microcode CPU matching issue - x86/microcode/intel: Refresh the revisions that determine old_microcode

In reply to Sohil Mehta
Quoted 20 lines · Sohil Mehta

Update the minimum expected revisions of Intel microcode based on the microcode-20250512 (May 2025) release.

---
.../kernel/cpu/microcode/intel-ucode-defs.h | 86 +++++++++++--------

1 file changed, 48 insertions(+), 38 deletions(-)
arch/x86/kernel/cpu/microcode/intel-ucode-defs.h +0 -2
index cb6e601701ab..2d48e6593540 100644
@@ -67,9 +67,8 @@
… snip …
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0100, .driver_data = 0x2c000390 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0080, .driver_data = 0x2b000603 },

arch/x86/kernel/cpu/microcode/intel-ucode-defs.h line 100

Quoted 10 lines
arch/x86/kernel/cpu/microcode/intel-ucode-defs.h +6 -3
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0040, .driver_data = 0x2c000390 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0020, .driver_data = 0x2c000390 },
-{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0010, .driver_data = 0x2c000390 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8e, .steppings = 0x1000, .driver_data = 0x100 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0010, .driver_data = 0x2c0003f7 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0020, .driver_data = 0x2c0003f7 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0040, .driver_data = 0x2c0003f7 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0080, .driver_data = 0x2b000639 },
+{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6,  .model = 0x8f, .steppings = 0x0100, .driver_data = 0x2c0003f7 },
… snip …

Hi LKML, Dave, Sohil,
Wanted to report a CPU matching issue I'm seeing on one of our SPR hosts, which results in it being flagged for old microcode, despite having the latest microcode early loaded.

Using 6.18 rc2 plus the latest newer microcode loaded from the Intel 20250812 release, it seems like this is matching a different stepping so the CPU is getting flagged as old.

Added a bit of logging prefixed with JKDBG:

[ 0.000000] microcode: JKDBG: about to load microcode (BSP)
[ 0.000000] microcode: JKDBG: microcode loaded (BSP): 0x2b000643
[ 0.000000] x86/CPU: JKDBG: MATCH microcode list entry: family 0x6, model 0x8f, steppings 0x100
[ 0.000000] x86/CPU: JKDBG: BOOT_CPU_DATA family 0x6, model 0x8f, stepping 0x8
[ 0.000000] x86/CPU: JKDBG: microcode is older than latest available: current 0x2b000643, latest 0x2c0003f7
[ 0.000000] x86/CPU: Running old microcode
...
[ 2.521338] smpboot: CPU0: Intel(R) Xeon(R) Gold 5416S (family: 0x6, model: 0x8f, stepping: 0x8)
...
[ 3.593063] microcode: Current revision: 0x2b000643
[ 3.593065] microcode: Updated early from: 0x2b0004b1

I reverted this patch, and also got the same matching, so it isn't regressed in 6.18, it just doesn't match like I'd expect. The microcode updater itself seems to work a-ok though.

With revert:

[ 0.000000] microcode: JKDBG: about to load microcode (BSP)
[ 0.000000] microcode: JKDBG: microcode loaded (BSP): 0x2b000643
[ 0.000000] x86/CPU: JKDBG: MATCH microcode list entry: family 0x6, model 0x8f, steppings 0x100
[ 0.000000] x86/CPU: JKDBG: BOOT_CPU_DATA family 0x6, model 0x8f, stepping 0x8
[ 0.000000] x86/CPU: JKDBG: microcode is older than latest available: current 0x2b000643, latest 0x2c000390
[ 0.000000] x86/CPU: Running old microcode
...
[ 4.448770] microcode: Current revision: 0x2b000643
[ 4.448772] microcode: Updated early from: 0x2b0004b1

Looking at the microcode release notes, I believe I’m supposed to be hitting SPR-SP 06-8f-08/87:
https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/releases/tag/microcode-20250812

What the matching code is coming up with though is Xeon Max, which I definitely am not running in my lab host.

Happy to collaborate on debugging if you’d like any more data points.

- Jon

#10 lore raw

Re: Old microcode CPU matching issue - x86/microcode/intel: Refresh the revisions that determine old_microcode

I think this is a platform mismatch problem. The microcode file for 06-8f-08 has two different versions for two different platforms:

	$ iucode-tool --list-all intel-ucode/06-8f-08 
	...
	           sig 0x000806f8, pf_mask 0x10, 2025-04-08, rev 0x2c000401
	...
	           sig 0x000806f8, pf_mask 0x87, 2025-04-04, rev 0x2b000643

Note the pf_mask and rev deltas here: ^^^^ ^^^^^^^^^^

I guess we'll need to take those into consideration, both adding pf_mask to the match list and actually matching on it.

#11 lore raw

Re: Old microcode CPU matching issue - x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 9 lines · Dave Hansen

I think this is a platform mismatch problem. The microcode file for 06-8f-08 has two different versions for two different platforms:

	$ iucode-tool --list-all intel-ucode/06-8f-08 
	...
	           sig 0x000806f8, pf_mask 0x10, 2025-04-08, rev 0x2c000401
	...
	           sig 0x000806f8, pf_mask 0x87, 2025-04-04, rev 0x2b000643
Quoted 4 lines

Note the pf_mask and rev deltas here: ^^^^ ^^^^^^^^^^

I guess we'll need to take those into consideration, both adding pf_mask to the match list and actually matching on it.

Jon,

Here is a completely untested series that might fix your issue:

https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git/log/?h=old-ucode-platform

It attempts to take IA32_PLATFORM_ID into account when considering old microcode.

#12 lore raw

Re: Old microcode CPU matching issue - x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 19 lines · Dave Hansen
Quoted 9 lines · Dave Hansen

I think this is a platform mismatch problem. The microcode file for 06-8f-08 has two different versions for two different platforms:

$ iucode-tool --list-all intel-ucode/06-8f-08 
...
          sig 0x000806f8, pf_mask 0x10, 2025-04-08, rev 0x2c000401
...
          sig 0x000806f8, pf_mask 0x87, 2025-04-04, rev 0x2b000643
Quoted 4 lines

Note the pf_mask and rev deltas here: ^^^^ ^^^^^^^^^^

I guess we'll need to take those into consideration, both adding pf_mask to the match list and actually matching on it.

Quoted 8 lines

Jon,

Here is a completely untested series that might fix your issue:

https://urldefense.proofpoint.com/v2/url?u=https-3A__git.kernel.org_pub_scm_linux_kernel_git_daveh_devel.git_log_-3Fh-3Dold-2Ducode-2Dplatform&d=DwICaQ&c=s883GpUCOChKOHiocYtGcg&r=NGPRGGo37mQiSXgHKm5rCQ&m=4zPePvFxfJXfp66SgLg_V32bsZLtf6acUOdSXGiOs7nHYrGTY8wvYIsVMdQwGguK&s=RASYUF-4djrYzQOFmSzkZbzpoWsg_qsGHiQJMcLGVhw&e=

It attempts to take IA32_PLATFORM_ID into account when considering old microcode.

Hey Dave - got a chance to give it a go, and this did not seem to solve the issue, and in fact it made it kinda worse as I didn’t end up seeing the microcode getting patched up at all now.

On 6.18 rc6 with a bit of debug logging added, still seeing the same

[    0.000000] x86/CPU: microcode 0x721421856 is older than minimum 0x721421881
[    0.000000] x86/CPU: MATCH LIST DATA: family 0x6, model 0x8f, steppings 0x100
[    0.000000] x86/CPU: BOOT_CPU_DATA: family 0x6, model 0x8f, stepping 0x8
[    0.000000] x86/CPU: Running old microcode
[    3.404176] microcode: Current revision: 0x2b000620 <<<<< I do have 0x2b000643 on the system, but it didn’t give me a notice that it updated early now

This was on this proc:
smpboot: CPU0: Intel(R) Xeon(R) Gold 5416S (family: 0x6, model: 0x8f, stepping: 0x8)

Jon

#13 lore raw

Re: Old microcode CPU matching issue - x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 8 lines · Jon Kohler
Quoted 3 lines

It attempts to take IA32_PLATFORM_ID into account when considering old microcode.

Hey Dave - got a chance to give it a go, and this did not seem to solve the issue, and in fact it made it kinda worse as I didn’t end up seeing the microcode getting patched up at all now.

There seems to be a simple bug in the patches. intel_get_platform_id() already returns a mask so x86_match_cpu() shouldn't do the BIT() operation for the platform_id.

Ignoring variable renames, this change (ontop of the patches) should atleast fix the x86_match_cpu() issue.

arch/x86/kernel/cpu/match.c +0 -0
index 23b13ffc6053..613860448855 100644
@@ -77,7 +77,7 @@ const struct x86_cpu_id *x86_match_cpu(const struct

x86_cpu_id *match)
!(BIT(c->x86_stepping) & m->steppings))
continue;
if (m->platform_mask != X86_PLATFORM_ANY &&
- !(BIT(c->x86_platform_id) & m->platform_mask))
+ !(c->x86_platform_id & m->platform_mask))
continue;
if (m->feature != X86_FEATURE_ANY && !cpu_has(c, m->feature))
continue;

Quoted 13 lines

On 6.18 rc6 with a bit of debug logging added, still seeing the same

[    0.000000] x86/CPU: microcode 0x721421856 is older than minimum 0x721421881
[    0.000000] x86/CPU: MATCH LIST DATA: family 0x6, model 0x8f, steppings 0x100
[    0.000000] x86/CPU: BOOT_CPU_DATA: family 0x6, model 0x8f, stepping 0x8
[    0.000000] x86/CPU: Running old microcode
[    3.404176] microcode: Current revision: 0x2b000620 <<<<< I do have 0x2b000643 on the system, but it didn’t give me a notice that it updated early now

This was on this proc:
smpboot: CPU0: Intel(R) Xeon(R) Gold 5416S (family: 0x6, model: 0x8f, stepping: 0x8)

Jon

#14 lore raw

Re: Old microcode CPU matching issue - x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 13 lines · Sohil Mehta
arch/x86/kernel/cpu/match.c +1 -1
index 23b13ffc6053..613860448855 100644
@@ -77,7 +77,7 @@ const struct x86_cpu_id *x86_match_cpu(const struct
 x86_cpu_id *match)
 		    !(BIT(c->x86_stepping) & m->steppings))
 			continue;
 		if (m->platform_mask != X86_PLATFORM_ANY &&
-		    !(BIT(c->x86_platform_id) & m->platform_mask))
+		    !(c->x86_platform_id & m->platform_mask))
 			continue;
 		if (m->feature != X86_FEATURE_ANY && !cpu_has(c, m->feature))
Quoted 12 lines

continue;

Quoted 8 lines

On 6.18 rc6 with a bit of debug logging added, still seeing the same

[    0.000000] x86/CPU: microcode 0x721421856 is older than minimum 0x721421881
[    0.000000] x86/CPU: MATCH LIST DATA: family 0x6, model 0x8f, steppings 0x100
[    0.000000] x86/CPU: BOOT_CPU_DATA: family 0x6, model 0x8f, stepping 0x8
[    0.000000] x86/CPU: Running old microcode
[    3.404176] microcode: Current revision: 0x2b000620 <<<<< I do have 0x2b000643 on the system, but it didn’t give me a notice that it updated early now

The early loading probably gets affected because intel_get_platform_id() relies on boot_cpu_data which isn't initialized when load_ucode_bsp() is called very early.

As you are clearly not running on a 25 year old processor maybe comment out the INTEL_PENTIUM_III_DESCHUTES check as below just for testing :)

(quoted diff) +0 -0

b/arch/x86/include/asm/microcode.h
index 6ec2d78c78f0..c1950902a593 100644

arch/x86/include/asm/microcode.h +2 -2
@@ -81,8 +81,8 @@ static inline u32 intel_get_platform_id(void)
 {
 	unsigned int val[2];
 
-	if (boot_cpu_data.x86_vfm < INTEL_PENTIUM_III_DESCHUTES)
-		return 0;
+	// if (boot_cpu_data.x86_vfm < INTEL_PENTIUM_III_DESCHUTES)
+	//	return 0;
 
 	/* get processor flags from MSR 0x17 */
 	native_rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]);

Both my suggestions are mainly to unblock your testing. An upstreamable fix would need some additional rework.

Quoted 2 lines
Quoted 2 lines

This was on this proc:
smpboot: CPU0: Intel(R) Xeon(R) Gold 5416S (family: 0x6, model: 0x8f, stepping: 0x8)

#15 lore raw

Re: Old microcode CPU matching issue - x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 3 lines · Sohil Mehta

The early loading probably gets affected because intel_get_platform_id() relies on boot_cpu_data which isn't initialized when load_ucode_bsp() is called very early.

Good point, and thanks for finding those bugs!

We can probably just move back to building the vfm value from CPUID directly as opposed to reading it from boot_cpu_data.

#16 lore raw

Re: Old microcode CPU matching issue - x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 8 lines · Dave Hansen
Quoted 3 lines · Sohil Mehta

The early loading probably gets affected because intel_get_platform_id() relies on boot_cpu_data which isn't initialized when load_ucode_bsp() is called very early.

Good point, and thanks for finding those bugs!

We can probably just move back to building the vfm value from CPUID directly as opposed to reading it from boot_cpu_data.

OK, here's a theoretically fixed up series. I actually booted this on real hardware and made sure I didn't break microcode loading in general:

https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git/log/?h=old-ucode-platform
The actual hardware I tested on was this one:

{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6, .model = 0x7a, .steppings = 0x0002, .platform_mask = 0x01, .driver_data = 0x42 },

For testing, I added a 100% made up but matching CPU model/family/stepping that has (made up) later microcode and a (made up) higher platform ID that I added to the ucode-defs.h file:

{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6, .model = 0x7a, .steppings = 0x0002, .platform_mask = 0x02, .driver_data = 0x43 },

Everything seemed to work OK for me in my limited but nonzero amount of testing.

Any additional testing or eyeballs on the code would be appreciated. I'll post it for real in a day or two if it all looks OK.

#17 lore raw

Re: Old microcode CPU matching issue - x86/microcode/intel: Refresh the revisions that determine old_microcode

Quoted 1 line · Dave Hansen

Any additional testing or eyeballs on the code would be appreciated.

I tried out the updated patches on an SPR system. With some made up entries the old_microcode flagging worked as expected.

#18 lore raw

Re: Old microcode CPU matching issue - x86/microcode/intel: Refresh the revisions that determine old_microcode

In reply to Dave Hansen
Quoted 26 lines · Dave Hansen
Quoted 8 lines · Dave Hansen
Quoted 3 lines · Sohil Mehta

The early loading probably gets affected because intel_get_platform_id() relies on boot_cpu_data which isn't initialized when load_ucode_bsp() is called very early.

Good point, and thanks for finding those bugs!

We can probably just move back to building the vfm value from CPUID directly as opposed to reading it from boot_cpu_data.

OK, here's a theoretically fixed up series. I actually booted this on real hardware and made sure I didn't break microcode loading in general:

https://urldefense.proofpoint.com/v2/url?u=https-3A__git.kernel.org_pub_scm_linux_kernel_git_daveh_devel.git_log_-3Fh-3Dold-2Ducode-2Dplatform&d=DwICaQ&c=s883GpUCOChKOHiocYtGcg&r=NGPRGGo37mQiSXgHKm5rCQ&m=Aj3XdJqTpjECR_fyNML3SeMNT46oTwjdjYY5YqPSZ0k2Er9zbK7KbRrCX3jepXXq&s=XwRvvtN9Ch3mUF4-T-_lRIJBcpDpHgt5ebg5Hgl8ylg&e=
The actual hardware I tested on was this one:

{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6, .model = 0x7a, .steppings = 0x0002, .platform_mask = 0x01, .driver_data = 0x42 },

For testing, I added a 100% made up but matching CPU model/family/stepping that has (made up) later microcode and a (made up) higher platform ID that I added to the ucode-defs.h file:

Quoted 7 lines

{ .flags = X86_CPU_ID_FLAG_ENTRY_VALID, .vendor = X86_VENDOR_INTEL, .family = 0x6, .model = 0x7a, .steppings = 0x0002, .platform_mask = 0x02, .driver_data = 0x43 },

Everything seemed to work OK for me in my limited but nonzero amount of testing.

Any additional testing or eyeballs on the code would be appreciated. I'll post it for real in a day or two if it all looks OK.

Looks like it works, no longer complains of old microcode, loading works

Tested with 6.18 rc6 + our internal patch queue + your latest patches

Before, it was broken as reported before. After, works good.

[    2.451421] smpboot: CPU0: Intel(R) Xeon(R) Gold 5416S (family: 0x6, model: 0x8f, stepping: 0x8)
[    3.503508] microcode: Current revision: 0x2b000643
[    3.503510] microcode: Updated early from: 0x2b000620

tested-by/reported-by Jon Kohler <[email protected] <mailto:[email protected]>>

Thanks for tackling this!

Cheers,
Jon

#19 lore raw

PATCH 2/2 scripts/x86: Add a script to update minimum Intel ucode revisions

In reply to Sohil Mehta

The kernel keeps a table of the minimum expected microcode revisions for Intel CPUs at intel-ucode-defs.h. Systems with microcode older those are marked with X86_BUG_OLD_MICROCODE. For more details, see Documentation/admin-guide/hw-vuln/old_microcode.rst.

Add a simple script to keep the header file up-to-date based on released microcode updates.

---
 MAINTAINERS                        |   1 +
 scripts/update-intel-ucode-defs.py | 134 +++++++++++++++++++++++++++++
 2 files changed, 135 insertions(+)
 create mode 100755 scripts/update-intel-ucode-defs.py
MAINTAINERS +1 -0
index daf520a13bdf..a819559ec672 100644
@@ -27260,6 +27260,7 @@ S:	Maintained
 F:	Documentation/admin-guide/hw-vuln/
 F:	arch/x86/include/asm/nospec-branch.h
 F:	arch/x86/kernel/cpu/bugs.c
+F:	scripts/update-intel-ucode-defs.py
 
 X86 MCE INFRASTRUCTURE
 M:	Tony Luck <[email protected]>
scripts/update-intel-ucode-defs.py new file +134 -0

134 lines not on this page · raw message

Signature · 1 line
2.43.0
#20 lore raw

Re: [PATCH 2/2] scripts/x86: Add a script to update minimum Intel ucode revisions

scripts/update-intel-ucode-defs.py line 43

Quoted 4 lines · Sohil Mehta
scripts/update-intel-ucode-defs.py new file +4 -0
+parser.add_argument('-u','--ucode_path', required=True,
+                    help='Path to the microcode files')
+parser.add_argument('-o','--output', dest='header', default=ucode_hdr,
+                    help='The microcode header file to be updated (default: intel-ucode-defs.h)')

So, thanks for fixing this up and adding the sorting.

But I'm not sure what the point is of making it less flexible and adding these command-line arguments to it. Before, I would just hand it a path to a bunch of ucode files, and dump the output somewhere:

	foo.py ~/path/* > out.h

I just went and tried to use my version of the script to dump headers for every microcode release:

	git rev-list --all | while read rev; do
		git checkout $rev;
		python3 dave.py ~/path/* > foo.${rev}.h
	done

But with your version, I can't do that. I have to create the header file, then point the script to it. I also have to consume microcode files from a single directory.

So, it's less flexible and harder to use with those command-line arguments. It's obviously not the end of the world, but why add code to the script for this? Why is it needed?

#21 lore raw

Re: [PATCH 2/2] scripts/x86: Add a script to update minimum Intel ucode revisions

Quoted 4 lines · Dave Hansen

But with your version, I can't do that. I have to create the header file, then point the script to it. I also have to consume microcode files from a single directory.

Consuming microcode from multiple directories is easy to fix, just need to add "nargs='+'" in the argument parser. Will change in the next revision.

Quoted 3 lines

So, it's less flexible and harder to use with those command-line arguments. It's obviously not the end of the world, but why add code to the script for this? Why is it needed?

Though the script is less flexible, my goal was to make it easier to use. When used within the kernel tree, it automatically selects and updates the header file, since that is always the same.

The usage was supposed to be simple and hard to mess up:

update.py -u /path/to/microcode/files

The header argument is only needed if someone uses the script outside the tree, which I assumed to be rare. But I understand this limits other usages.

To make it flexible again, I can get rid of the parameters and make it print to standard output. Users would then redirect it as needed.

update.py /path/to/files1 /path/to/files2 > /path/to/ucode-def.h