aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/cpu/amd.c3
-rw-r--r--arch/x86/kernel/setup_64.c4
-rw-r--r--include/asm-x86/cpufeature.h1
3 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 1ff88c7f45cf..aaa8101d3d80 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -301,6 +301,9 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
301 /* K6s reports MCEs but don't actually have all the MSRs */ 301 /* K6s reports MCEs but don't actually have all the MSRs */
302 if (c->x86 < 6) 302 if (c->x86 < 6)
303 clear_bit(X86_FEATURE_MCE, c->x86_capability); 303 clear_bit(X86_FEATURE_MCE, c->x86_capability);
304
305 if (cpu_has_xmm)
306 set_bit(X86_FEATURE_MFENCE_RDTSC, c->x86_capability);
304} 307}
305 308
306static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 * c, unsigned int size) 309static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 * c, unsigned int size)
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 02409100f456..2139aa6ac469 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -746,8 +746,8 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
746 if (c->x86 == 0xf || c->x86 == 0x10 || c->x86 == 0x11) 746 if (c->x86 == 0xf || c->x86 == 0x10 || c->x86 == 0x11)
747 set_cpu_cap(c, X86_FEATURE_K8); 747 set_cpu_cap(c, X86_FEATURE_K8);
748 748
749 /* RDTSC can be speculated around */ 749 /* MFENCE stops RDTSC speculation */
750 clear_cpu_cap(c, X86_FEATURE_SYNC_RDTSC); 750 set_cpu_cap(c, X86_FEATURE_MFENCE_RDTSC);
751 751
752 /* Family 10 doesn't support C states in MWAIT so don't use it */ 752 /* Family 10 doesn't support C states in MWAIT so don't use it */
753 if (c->x86 == 0x10 && !force_mwait) 753 if (c->x86 == 0x10 && !force_mwait)
diff --git a/include/asm-x86/cpufeature.h b/include/asm-x86/cpufeature.h
index 75e2f78a7fda..7d53eea8b946 100644
--- a/include/asm-x86/cpufeature.h
+++ b/include/asm-x86/cpufeature.h
@@ -79,6 +79,7 @@
79/* 14 free */ 79/* 14 free */
80#define X86_FEATURE_SYNC_RDTSC (3*32+15) /* RDTSC synchronizes the CPU */ 80#define X86_FEATURE_SYNC_RDTSC (3*32+15) /* RDTSC synchronizes the CPU */
81#define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ 81#define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */
82#define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* Mfence synchronizes RDTSC */
82 83
83/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ 84/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
84#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ 85#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */