Skip to content

Commit 7e6b0a2

Browse files
sohilmehIngo Molnar
authored andcommitted
x86/microcode: Update the Intel processor flag scan check
The Family model check to read the processor flag MSR is misleading and potentially incorrect. It doesn't consider Family while comparing the model number. The original check did have a Family number but it got lost/moved during refactoring. intel_collect_cpu_info() is called through multiple paths such as early initialization, CPU hotplug as well as IFS image load. Some of these flows would be error prone due to the ambiguous check. Correct the processor flag scan check to use a Family number and update it to a VFM based one to make it more readable. Signed-off-by: Sohil Mehta <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Acked-by: Dave Hansen <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7e67f36 commit 7e6b0a2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

arch/x86/include/asm/intel-family.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#define INTEL_ANY IFM(X86_FAMILY_ANY, X86_MODEL_ANY)
4747

4848
#define INTEL_PENTIUM_PRO IFM(6, 0x01)
49+
#define INTEL_PENTIUM_III_DESCHUTES IFM(6, 0x05)
4950

5051
#define INTEL_CORE_YONAH IFM(6, 0x0E)
5152

arch/x86/kernel/cpu/microcode/intel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void intel_collect_cpu_info(struct cpu_signature *sig)
7474
sig->pf = 0;
7575
sig->rev = intel_get_microcode_revision();
7676

77-
if (x86_model(sig->sig) >= 5 || x86_family(sig->sig) > 6) {
77+
if (IFM(x86_family(sig->sig), x86_model(sig->sig)) >= INTEL_PENTIUM_III_DESCHUTES) {
7878
unsigned int val[2];
7979

8080
/* get processor flags from MSR 0x17 */

0 commit comments

Comments
 (0)