Re: [PATCH 3/6] x86/microcode: Refactor platform ID enumeration into a helper

From: Chao Gao

Date: Mon Jan 19 2026 - 22:07:55 EST


On Mon, Jan 19, 2026 at 11:50:53AM -0800, Dave Hansen wrote:
>
>From: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
>
>The only code that cares about the platform ID is the microcode update
>code itself. To facilitate storing the platform ID in a more generic
>place and using it outside of the microcode update itself, put the
>enumeration into a helper function in a header. Mirror
>intel_get_microcode_revision()'s naming and location.
>
>But, moving away from intel_collect_cpu_info() means that the model
>and family information in CPUID is not readily available. Just call
>CPUID again.
>
>Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
>Cc: Thomas Gleixner <tglx@xxxxxxxxxx>
>Cc: Ingo Molnar <mingo@xxxxxxxxxx>
>Cc: Borislav Petkov <bp@xxxxxxxxx>
>Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
>Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
>Cc: Tony Luck <tony.luck@xxxxxxxxx>
>Cc: Pawan Gupta <pawan.kumar.gupta@xxxxxxxxxxxxxxx>
>Cc: "Peter Zijlstra (Intel)" <peterz@xxxxxxxxxxxxx>
>Cc: x86@xxxxxxxxxx
>Cc: Jon Kohler <jon@xxxxxxxxxxx>
>---
>
> b/arch/x86/include/asm/microcode.h | 31 +++++++++++++++++++++++++++++++
> b/arch/x86/kernel/cpu/microcode/intel.c | 10 +---------
> 2 files changed, 32 insertions(+), 9 deletions(-)
>
>diff -puN arch/x86/include/asm/microcode.h~refactor-get-processor-flags arch/x86/include/asm/microcode.h
>--- a/arch/x86/include/asm/microcode.h~refactor-get-processor-flags 2026-01-19 11:38:08.775892390 -0800
>+++ b/arch/x86/include/asm/microcode.h 2026-01-19 11:38:08.783892696 -0800
>@@ -2,7 +2,9 @@
> #ifndef _ASM_X86_MICROCODE_H
> #define _ASM_X86_MICROCODE_H
>
>+#include <asm/cpu.h>
> #include <asm/msr.h>
>+#include <asm/intel-family.h>

nit: You may want to sort the header files alphabetically.