Skip to contentSkip to conversation

x86, microcode, AMD: Restrict microcode reporting

PATCH New Borislav Petkov 1 participant 1 message Nov 15, 2011 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86, microcode, AMD: Restrict microcode reporting

From: Borislav Petkov <[email protected]>

bcb80e53877c ("x86, microcode, AMD: Add microcode revision to /proc/cpuinfo") added support for dumping microcode patch level in /proc/cpuinfo on AMD. Although we were very cautious and did rdmsr_safe the microcode patch level MSR, this broke booting on Geode LX because this CPU doesn't have that MSR and at the time we do the read, exception tables which are used by rdmsr_safe are not yet initialized, leading to the boot hang.

This is the simple fix which enables the microcode line in /proc/cpuinfo for K8 and newer (it is not that interesting for older boxes anyway :-)).

---
 arch/x86/kernel/cpu/amd.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/amd.c +2 -1
index c7e46cb..a72d183 100644
@@ -474,7 +474,8 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
 	}
 #endif
 
-	rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
+	if (c->x86 >= 0xf)
+		rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
 }
 
 static void __cpuinit init_amd(struct cpuinfo_x86 *c)
Signature · 1 line
1.7.8.rc0