From: Ingo Molnar <mingo@elte.hu>
Date: Fri, 1 Feb 2008 22:45:18 +0000 (+0100)
Subject: x86: fix bootup crash in native_read_tsc()
X-Git-Tag: firefly_0821_release~23570
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=aa6299926950c8dfe2fea638276cad6def092bc9;p=firefly-linux-kernel-4.4.55.git

x86: fix bootup crash in native_read_tsc()

fix bootup crash in native_read_tsc() that was reported on an Athlon-XP
and bisected. The correct feature boundary for X86_FEATURE_MFENCE_RDTSC
is not XMM but XMM2.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 06fa159232fd..693e353999cd 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -304,7 +304,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 	if (c->x86 < 6)
 		clear_bit(X86_FEATURE_MCE, c->x86_capability);
 
-	if (cpu_has_xmm)
+	if (cpu_has_xmm2)
 		set_bit(X86_FEATURE_MFENCE_RDTSC, c->x86_capability);
 }