]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/microcode: Refactor platform ID enumeration into a helper
authorDave Hansen <dave.hansen@linux.intel.com>
Wed, 4 Mar 2026 18:10:18 +0000 (10:10 -0800)
committerDave Hansen <dave.hansen@linux.intel.com>
Thu, 5 Mar 2026 20:25:18 +0000 (12:25 -0800)
commit238be4ba87605da69de2131e8736be7a0d299e00
treeca682a8f05bc8fa7f4214d5a681d92ae60d4fcc1
parent11439c4635edd669ae435eec308f4ab8a0804808
x86/microcode: Refactor platform ID enumeration into a helper

Today, 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. 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.

Note that the microcode header is a mask of supported platform IDs.
Only stick the ID part in the helper. Leave the 1<<id part in the
microcode handling.

Also note that the PII is weird. It does not really have a platform
ID because it doesn't even have the MSR. Just consider it to be
platform ID 0. Instead of saying >=PII, say <=PII. The PII is the
real oddball here being the only CPU with Linux microcode updates
but no platform ID. It's worth calling it out by name.

This does subtly change the sig->pf for the PII though from 0x0
to 0x1. Make up for that by ignoring sig->pf when the microcode
update platform mask is 0x0.

[ dhansen: reflow comment for bpetkov ]

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>
Reviewed-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Link: https://patch.msgid.link/20260304181018.EB6404F8@davehans-spike.ostc.intel.com
arch/x86/kernel/cpu/microcode/intel.c