diff options
-rw-r--r-- | arch/x86/include/asm/cpufeatures.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mwait.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel.c | 5 | ||||
-rw-r--r-- | arch/x86/kernel/process.c | 2 |
4 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index c64b1e9c5d1a..19ecc6e11f4f 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h | |||
@@ -310,5 +310,5 @@ | |||
310 | #endif | 310 | #endif |
311 | #define X86_BUG_NULL_SEG X86_BUG(10) /* Nulling a selector preserves the base */ | 311 | #define X86_BUG_NULL_SEG X86_BUG(10) /* Nulling a selector preserves the base */ |
312 | #define X86_BUG_SWAPGS_FENCE X86_BUG(11) /* SWAPGS without input dep on GS */ | 312 | #define X86_BUG_SWAPGS_FENCE X86_BUG(11) /* SWAPGS without input dep on GS */ |
313 | 313 | #define X86_BUG_MONITOR X86_BUG(12) /* IPI required to wake up remote CPU */ | |
314 | #endif /* _ASM_X86_CPUFEATURES_H */ | 314 | #endif /* _ASM_X86_CPUFEATURES_H */ |
diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h index 0deeb2d26df7..f37f2d8a2989 100644 --- a/arch/x86/include/asm/mwait.h +++ b/arch/x86/include/asm/mwait.h | |||
@@ -97,7 +97,7 @@ static inline void __sti_mwait(unsigned long eax, unsigned long ecx) | |||
97 | */ | 97 | */ |
98 | static inline void mwait_idle_with_hints(unsigned long eax, unsigned long ecx) | 98 | static inline void mwait_idle_with_hints(unsigned long eax, unsigned long ecx) |
99 | { | 99 | { |
100 | if (!current_set_polling_and_test()) { | 100 | if (static_cpu_has_bug(X86_BUG_MONITOR) || !current_set_polling_and_test()) { |
101 | if (static_cpu_has_bug(X86_BUG_CLFLUSH_MONITOR)) { | 101 | if (static_cpu_has_bug(X86_BUG_CLFLUSH_MONITOR)) { |
102 | mb(); | 102 | mb(); |
103 | clflush((void *)¤t_thread_info()->flags); | 103 | clflush((void *)¤t_thread_info()->flags); |
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index c1a89bc026ac..abf601235b29 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/msr.h> | 13 | #include <asm/msr.h> |
14 | #include <asm/bugs.h> | 14 | #include <asm/bugs.h> |
15 | #include <asm/cpu.h> | 15 | #include <asm/cpu.h> |
16 | #include <asm/intel-family.h> | ||
16 | 17 | ||
17 | #ifdef CONFIG_X86_64 | 18 | #ifdef CONFIG_X86_64 |
18 | #include <linux/topology.h> | 19 | #include <linux/topology.h> |
@@ -508,6 +509,10 @@ static void init_intel(struct cpuinfo_x86 *c) | |||
508 | (c->x86_model == 29 || c->x86_model == 46 || c->x86_model == 47)) | 509 | (c->x86_model == 29 || c->x86_model == 46 || c->x86_model == 47)) |
509 | set_cpu_bug(c, X86_BUG_CLFLUSH_MONITOR); | 510 | set_cpu_bug(c, X86_BUG_CLFLUSH_MONITOR); |
510 | 511 | ||
512 | if (c->x86 == 6 && boot_cpu_has(X86_FEATURE_MWAIT) && | ||
513 | ((c->x86_model == INTEL_FAM6_ATOM_GOLDMONT))) | ||
514 | set_cpu_bug(c, X86_BUG_MONITOR); | ||
515 | |||
511 | #ifdef CONFIG_X86_64 | 516 | #ifdef CONFIG_X86_64 |
512 | if (c->x86 == 15) | 517 | if (c->x86 == 15) |
513 | c->x86_cache_alignment = c->x86_clflush_size * 2; | 518 | c->x86_cache_alignment = c->x86_clflush_size * 2; |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 96becbbb52e0..59f68f1d734b 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -404,7 +404,7 @@ static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c) | |||
404 | if (c->x86_vendor != X86_VENDOR_INTEL) | 404 | if (c->x86_vendor != X86_VENDOR_INTEL) |
405 | return 0; | 405 | return 0; |
406 | 406 | ||
407 | if (!cpu_has(c, X86_FEATURE_MWAIT)) | 407 | if (!cpu_has(c, X86_FEATURE_MWAIT) || static_cpu_has_bug(X86_BUG_MONITOR)) |
408 | return 0; | 408 | return 0; |
409 | 409 | ||
410 | return 1; | 410 | return 1; |