* [PATCH] x86/cpu: Sort the Intel microcode defines by Family-model-stepping
@ 2025-07-15 2:00 Sohil Mehta
2025-07-15 3:33 ` Dave Hansen
0 siblings, 1 reply; 3+ messages in thread
From: Sohil Mehta @ 2025-07-15 2:00 UTC (permalink / raw)
To: Dave Hansen, x86
Cc: Borislav Petkov, H . Peter Anvin, Thomas Gleixner, Ingo Molnar,
Sohil Mehta, linux-kernel
Keeping the Intel microcode defines sorted by Family-model-stepping is
crucial to its long-term maintainability. This would prevent unnecessary
changes and duplicate entries whenever they are updated.
Thankfully, most of the entries are already sorted, with only a few
exceptions. Move the outliers to their correct positions.
Include a Fixes tag, since future changes to the file are likely to be
backported to stable kernels.
No functional change.
Fixes: 4e2c719782a8 ("x86/cpu: Help users notice when running old Intel microcode")
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
---
arch/x86/kernel/cpu/microcode/intel-ucode-defs.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/cpu/microcode/intel-ucode-defs.h b/arch/x86/kernel/cpu/microcode/intel-ucode-defs.h
index cb6e601701ab..e780d611f02e 100644
--- a/arch/x86/kernel/cpu/microcode/intel-ucode-defs.h
+++ b/arch/x86/kernel/cpu/microcode/intel-ucode-defs.h
@@ -94,16 +94,14 @@
{ .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 = 0x8f, .steppings = 0x0020, .driver_data = 0x2c000390 },
+{ .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 = 0x0080, .driver_data = 0x2b000603 },
+{ .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 = 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 = 0x9c, .steppings = 0x0001, .driver_data = 0x24000026 },
@@ -124,8 +122,10 @@
{ .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 = 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 = 0xcf, .steppings = 0x0002, .driver_data = 0x21000283 },
+{ .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 = 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 },
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/cpu: Sort the Intel microcode defines by Family-model-stepping
2025-07-15 2:00 [PATCH] x86/cpu: Sort the Intel microcode defines by Family-model-stepping Sohil Mehta
@ 2025-07-15 3:33 ` Dave Hansen
2025-07-15 18:02 ` Sohil Mehta
0 siblings, 1 reply; 3+ messages in thread
From: Dave Hansen @ 2025-07-15 3:33 UTC (permalink / raw)
To: Sohil Mehta, Dave Hansen, x86
Cc: Borislav Petkov, H . Peter Anvin, Thomas Gleixner, Ingo Molnar,
linux-kernel
On 7/14/25 19:00, Sohil Mehta wrote:
> Keeping the Intel microcode defines sorted by Family-model-stepping is
> crucial to its long-term maintainability. This would prevent unnecessary
> changes and duplicate entries whenever they are updated.
I've been procrastinating putting my script that generated that file
into the tree. But we should probably just have it do the sorting and
just update the file the next time we update the microcode versions.
But either way, I'm not concerned about maintainability. I just re-run
the script and regenerate the whole file each time.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/cpu: Sort the Intel microcode defines by Family-model-stepping
2025-07-15 3:33 ` Dave Hansen
@ 2025-07-15 18:02 ` Sohil Mehta
0 siblings, 0 replies; 3+ messages in thread
From: Sohil Mehta @ 2025-07-15 18:02 UTC (permalink / raw)
To: Dave Hansen, Dave Hansen, x86
Cc: Borislav Petkov, H . Peter Anvin, Thomas Gleixner, Ingo Molnar,
linux-kernel
On 7/14/2025 8:33 PM, Dave Hansen wrote:
> On 7/14/25 19:00, Sohil Mehta wrote:
>> Keeping the Intel microcode defines sorted by Family-model-stepping is
>> crucial to its long-term maintainability. This would prevent unnecessary
>> changes and duplicate entries whenever they are updated.
>
> I've been procrastinating putting my script that generated that file
> into the tree. But we should probably just have it do the sorting and
> just update the file the next time we update the microcode versions.
>
The output was a result of exactly that. I am preparing the script to
merge it into the kernel. But when I ran the script, I couldn't
accurately reproduce what is currently there in intel-ucode-defs.h.
I added the sorting to keep it consistent in the future. But, I figured
for a particular microcode release, let's say 29f82f7429c
("microcode-20241029 Release") we should have a unique and matching
intel-ucode-defs.h.
Sure, we could start enforcing this with the next time we update the
header. However, since the file may be shared across stable kernels, it
seemed valuable to change the first version as well.
> But either way, I'm not concerned about maintainability. I just re-run
> the script and regenerate the whole file each time.
Yeah, the sorting is mainly to make it easier to review what is changing
in the file with every update.
Anyway, I'll leave the maintainability aspect of this up to you :)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-15 18:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-15 2:00 [PATCH] x86/cpu: Sort the Intel microcode defines by Family-model-stepping Sohil Mehta
2025-07-15 3:33 ` Dave Hansen
2025-07-15 18:02 ` Sohil Mehta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®