diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-30 15:56:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-30 15:56:26 -0400 |
commit | b325e04ea21081439f0f3e7fe1117e883a9031d8 (patch) | |
tree | e5796e4e5e0e3bc5e987ab40888830dbbf258c8c | |
parent | 7f7d556496a025e5334d52df9e1ebe3674cda22a (diff) | |
parent | 08e237fa56a1d95c1372033bc29c4a2517b3c0fa (diff) |
Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cpufeature updates from Thomas Gleixner:
- a workaround for the MONITOR instruction erratum of Goldmont CPUs
- small fixes and cleanups here and there
* 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/cpu: Add workaround for MONITOR instruction erratum on Goldmont based CPUs
x86/cpu: Rename "WESTMERE2" family to "NEHALEM_G"
x86/amd_nb: Clean up init path
x86/cpufeature: Add helper macro for mask check macros
x86/cpufeature: Make sure DISABLED/REQUIRED macros are updated
x86/cpufeature: Update cpufeaure macros
-rw-r--r-- | arch/x86/events/msr.c | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/cpufeature.h | 90 | ||||
-rw-r--r-- | arch/x86/include/asm/cpufeatures.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/disabled-features.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/intel-family.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/mwait.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/required-features.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/amd_nb.c | 37 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel.c | 5 | ||||
-rw-r--r-- | arch/x86/kernel/process.c | 2 | ||||
-rw-r--r-- | drivers/idle/intel_idle.c | 2 |
11 files changed, 83 insertions, 67 deletions
diff --git a/arch/x86/events/msr.c b/arch/x86/events/msr.c index 50b3a056f96b..4bb3ec69e8ea 100644 --- a/arch/x86/events/msr.c +++ b/arch/x86/events/msr.c | |||
@@ -36,11 +36,11 @@ static bool test_intel(int idx) | |||
36 | 36 | ||
37 | switch (boot_cpu_data.x86_model) { | 37 | switch (boot_cpu_data.x86_model) { |
38 | case INTEL_FAM6_NEHALEM: | 38 | case INTEL_FAM6_NEHALEM: |
39 | case INTEL_FAM6_NEHALEM_G: | ||
39 | case INTEL_FAM6_NEHALEM_EP: | 40 | case INTEL_FAM6_NEHALEM_EP: |
40 | case INTEL_FAM6_NEHALEM_EX: | 41 | case INTEL_FAM6_NEHALEM_EX: |
41 | 42 | ||
42 | case INTEL_FAM6_WESTMERE: | 43 | case INTEL_FAM6_WESTMERE: |
43 | case INTEL_FAM6_WESTMERE2: | ||
44 | case INTEL_FAM6_WESTMERE_EP: | 44 | case INTEL_FAM6_WESTMERE_EP: |
45 | case INTEL_FAM6_WESTMERE_EX: | 45 | case INTEL_FAM6_WESTMERE_EX: |
46 | 46 | ||
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 483fb547e3c0..1d2b69fc0ceb 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -49,43 +49,59 @@ extern const char * const x86_bug_flags[NBUGINTS*32]; | |||
49 | #define test_cpu_cap(c, bit) \ | 49 | #define test_cpu_cap(c, bit) \ |
50 | test_bit(bit, (unsigned long *)((c)->x86_capability)) | 50 | test_bit(bit, (unsigned long *)((c)->x86_capability)) |
51 | 51 | ||
52 | #define REQUIRED_MASK_BIT_SET(bit) \ | 52 | /* |
53 | ( (((bit)>>5)==0 && (1UL<<((bit)&31) & REQUIRED_MASK0 )) || \ | 53 | * There are 32 bits/features in each mask word. The high bits |
54 | (((bit)>>5)==1 && (1UL<<((bit)&31) & REQUIRED_MASK1 )) || \ | 54 | * (selected with (bit>>5) give us the word number and the low 5 |
55 | (((bit)>>5)==2 && (1UL<<((bit)&31) & REQUIRED_MASK2 )) || \ | 55 | * bits give us the bit/feature number inside the word. |
56 | (((bit)>>5)==3 && (1UL<<((bit)&31) & REQUIRED_MASK3 )) || \ | 56 | * (1UL<<((bit)&31) gives us a mask for the feature_bit so we can |
57 | (((bit)>>5)==4 && (1UL<<((bit)&31) & REQUIRED_MASK4 )) || \ | 57 | * see if it is set in the mask word. |
58 | (((bit)>>5)==5 && (1UL<<((bit)&31) & REQUIRED_MASK5 )) || \ | 58 | */ |
59 | (((bit)>>5)==6 && (1UL<<((bit)&31) & REQUIRED_MASK6 )) || \ | 59 | #define CHECK_BIT_IN_MASK_WORD(maskname, word, bit) \ |
60 | (((bit)>>5)==7 && (1UL<<((bit)&31) & REQUIRED_MASK7 )) || \ | 60 | (((bit)>>5)==(word) && (1UL<<((bit)&31) & maskname##word )) |
61 | (((bit)>>5)==8 && (1UL<<((bit)&31) & REQUIRED_MASK8 )) || \ | 61 | |
62 | (((bit)>>5)==9 && (1UL<<((bit)&31) & REQUIRED_MASK9 )) || \ | 62 | #define REQUIRED_MASK_BIT_SET(feature_bit) \ |
63 | (((bit)>>5)==10 && (1UL<<((bit)&31) & REQUIRED_MASK10)) || \ | 63 | ( CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 0, feature_bit) || \ |
64 | (((bit)>>5)==11 && (1UL<<((bit)&31) & REQUIRED_MASK11)) || \ | 64 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 1, feature_bit) || \ |
65 | (((bit)>>5)==12 && (1UL<<((bit)&31) & REQUIRED_MASK12)) || \ | 65 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 2, feature_bit) || \ |
66 | (((bit)>>5)==13 && (1UL<<((bit)&31) & REQUIRED_MASK13)) || \ | 66 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 3, feature_bit) || \ |
67 | (((bit)>>5)==14 && (1UL<<((bit)&31) & REQUIRED_MASK14)) || \ | 67 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 4, feature_bit) || \ |
68 | (((bit)>>5)==15 && (1UL<<((bit)&31) & REQUIRED_MASK15)) || \ | 68 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 5, feature_bit) || \ |
69 | (((bit)>>5)==16 && (1UL<<((bit)&31) & REQUIRED_MASK16)) ) | 69 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 6, feature_bit) || \ |
70 | 70 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 7, feature_bit) || \ | |
71 | #define DISABLED_MASK_BIT_SET(bit) \ | 71 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 8, feature_bit) || \ |
72 | ( (((bit)>>5)==0 && (1UL<<((bit)&31) & DISABLED_MASK0 )) || \ | 72 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 9, feature_bit) || \ |
73 | (((bit)>>5)==1 && (1UL<<((bit)&31) & DISABLED_MASK1 )) || \ | 73 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 10, feature_bit) || \ |
74 | (((bit)>>5)==2 && (1UL<<((bit)&31) & DISABLED_MASK2 )) || \ | 74 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 11, feature_bit) || \ |
75 | (((bit)>>5)==3 && (1UL<<((bit)&31) & DISABLED_MASK3 )) || \ | 75 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 12, feature_bit) || \ |
76 | (((bit)>>5)==4 && (1UL<<((bit)&31) & DISABLED_MASK4 )) || \ | 76 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 13, feature_bit) || \ |
77 | (((bit)>>5)==5 && (1UL<<((bit)&31) & DISABLED_MASK5 )) || \ | 77 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 14, feature_bit) || \ |
78 | (((bit)>>5)==6 && (1UL<<((bit)&31) & DISABLED_MASK6 )) || \ | 78 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 15, feature_bit) || \ |
79 | (((bit)>>5)==7 && (1UL<<((bit)&31) & DISABLED_MASK7 )) || \ | 79 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 16, feature_bit) || \ |
80 | (((bit)>>5)==8 && (1UL<<((bit)&31) & DISABLED_MASK8 )) || \ | 80 | CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 17, feature_bit) || \ |
81 | (((bit)>>5)==9 && (1UL<<((bit)&31) & DISABLED_MASK9 )) || \ | 81 | REQUIRED_MASK_CHECK || \ |
82 | (((bit)>>5)==10 && (1UL<<((bit)&31) & DISABLED_MASK10)) || \ | 82 | BUILD_BUG_ON_ZERO(NCAPINTS != 18)) |
83 | (((bit)>>5)==11 && (1UL<<((bit)&31) & DISABLED_MASK11)) || \ | 83 | |
84 | (((bit)>>5)==12 && (1UL<<((bit)&31) & DISABLED_MASK12)) || \ | 84 | #define DISABLED_MASK_BIT_SET(feature_bit) \ |
85 | (((bit)>>5)==13 && (1UL<<((bit)&31) & DISABLED_MASK13)) || \ | 85 | ( CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 0, feature_bit) || \ |
86 | (((bit)>>5)==14 && (1UL<<((bit)&31) & DISABLED_MASK14)) || \ | 86 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 1, feature_bit) || \ |
87 | (((bit)>>5)==15 && (1UL<<((bit)&31) & DISABLED_MASK15)) || \ | 87 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 2, feature_bit) || \ |
88 | (((bit)>>5)==16 && (1UL<<((bit)&31) & DISABLED_MASK16)) ) | 88 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 3, feature_bit) || \ |
89 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 4, feature_bit) || \ | ||
90 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 5, feature_bit) || \ | ||
91 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 6, feature_bit) || \ | ||
92 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 7, feature_bit) || \ | ||
93 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 8, feature_bit) || \ | ||
94 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 9, feature_bit) || \ | ||
95 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 10, feature_bit) || \ | ||
96 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 11, feature_bit) || \ | ||
97 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 12, feature_bit) || \ | ||
98 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 13, feature_bit) || \ | ||
99 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 14, feature_bit) || \ | ||
100 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 15, feature_bit) || \ | ||
101 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 16, feature_bit) || \ | ||
102 | CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 17, feature_bit) || \ | ||
103 | DISABLED_MASK_CHECK || \ | ||
104 | BUILD_BUG_ON_ZERO(NCAPINTS != 18)) | ||
89 | 105 | ||
90 | #define cpu_has(c, bit) \ | 106 | #define cpu_has(c, bit) \ |
91 | (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \ | 107 | (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \ |
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index d683993248c8..92a8308b96f6 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h | |||
@@ -309,5 +309,5 @@ | |||
309 | #endif | 309 | #endif |
310 | #define X86_BUG_NULL_SEG X86_BUG(10) /* Nulling a selector preserves the base */ | 310 | #define X86_BUG_NULL_SEG X86_BUG(10) /* Nulling a selector preserves the base */ |
311 | #define X86_BUG_SWAPGS_FENCE X86_BUG(11) /* SWAPGS without input dep on GS */ | 311 | #define X86_BUG_SWAPGS_FENCE X86_BUG(11) /* SWAPGS without input dep on GS */ |
312 | 312 | #define X86_BUG_MONITOR X86_BUG(12) /* IPI required to wake up remote CPU */ | |
313 | #endif /* _ASM_X86_CPUFEATURES_H */ | 313 | #endif /* _ASM_X86_CPUFEATURES_H */ |
diff --git a/arch/x86/include/asm/disabled-features.h b/arch/x86/include/asm/disabled-features.h index 911e9358ceb1..85599ad4d024 100644 --- a/arch/x86/include/asm/disabled-features.h +++ b/arch/x86/include/asm/disabled-features.h | |||
@@ -56,5 +56,7 @@ | |||
56 | #define DISABLED_MASK14 0 | 56 | #define DISABLED_MASK14 0 |
57 | #define DISABLED_MASK15 0 | 57 | #define DISABLED_MASK15 0 |
58 | #define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE) | 58 | #define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE) |
59 | #define DISABLED_MASK17 0 | ||
60 | #define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 18) | ||
59 | 61 | ||
60 | #endif /* _ASM_X86_DISABLED_FEATURES_H */ | 62 | #endif /* _ASM_X86_DISABLED_FEATURES_H */ |
diff --git a/arch/x86/include/asm/intel-family.h b/arch/x86/include/asm/intel-family.h index 6999f7d01a0d..627719475457 100644 --- a/arch/x86/include/asm/intel-family.h +++ b/arch/x86/include/asm/intel-family.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * "Extreme" ones, like Broadwell-E. | 8 | * "Extreme" ones, like Broadwell-E. |
9 | * | 9 | * |
10 | * Things ending in "2" are usually because we have no better | 10 | * Things ending in "2" are usually because we have no better |
11 | * name for them. There's no processor called "WESTMERE2". | 11 | * name for them. There's no processor called "SILVERMONT2". |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #define INTEL_FAM6_CORE_YONAH 0x0E | 14 | #define INTEL_FAM6_CORE_YONAH 0x0E |
@@ -18,10 +18,10 @@ | |||
18 | #define INTEL_FAM6_CORE2_DUNNINGTON 0x1D | 18 | #define INTEL_FAM6_CORE2_DUNNINGTON 0x1D |
19 | 19 | ||
20 | #define INTEL_FAM6_NEHALEM 0x1E | 20 | #define INTEL_FAM6_NEHALEM 0x1E |
21 | #define INTEL_FAM6_NEHALEM_G 0x1F /* Auburndale / Havendale */ | ||
21 | #define INTEL_FAM6_NEHALEM_EP 0x1A | 22 | #define INTEL_FAM6_NEHALEM_EP 0x1A |
22 | #define INTEL_FAM6_NEHALEM_EX 0x2E | 23 | #define INTEL_FAM6_NEHALEM_EX 0x2E |
23 | #define INTEL_FAM6_WESTMERE 0x25 | 24 | #define INTEL_FAM6_WESTMERE 0x25 |
24 | #define INTEL_FAM6_WESTMERE2 0x1F | ||
25 | #define INTEL_FAM6_WESTMERE_EP 0x2C | 25 | #define INTEL_FAM6_WESTMERE_EP 0x2C |
26 | #define INTEL_FAM6_WESTMERE_EX 0x2F | 26 | #define INTEL_FAM6_WESTMERE_EX 0x2F |
27 | 27 | ||
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/include/asm/required-features.h b/arch/x86/include/asm/required-features.h index 4916144e3c42..fac9a5c0abe9 100644 --- a/arch/x86/include/asm/required-features.h +++ b/arch/x86/include/asm/required-features.h | |||
@@ -99,5 +99,7 @@ | |||
99 | #define REQUIRED_MASK14 0 | 99 | #define REQUIRED_MASK14 0 |
100 | #define REQUIRED_MASK15 0 | 100 | #define REQUIRED_MASK15 0 |
101 | #define REQUIRED_MASK16 0 | 101 | #define REQUIRED_MASK16 0 |
102 | #define REQUIRED_MASK17 0 | ||
103 | #define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 18) | ||
102 | 104 | ||
103 | #endif /* _ASM_X86_REQUIRED_FEATURES_H */ | 105 | #endif /* _ASM_X86_REQUIRED_FEATURES_H */ |
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c index e991d5c8bb3a..e45ec2b4e15e 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c | |||
@@ -219,24 +219,22 @@ int amd_set_subcaches(int cpu, unsigned long mask) | |||
219 | return 0; | 219 | return 0; |
220 | } | 220 | } |
221 | 221 | ||
222 | static int amd_cache_gart(void) | 222 | static void amd_cache_gart(void) |
223 | { | 223 | { |
224 | u16 i; | 224 | u16 i; |
225 | 225 | ||
226 | if (!amd_nb_has_feature(AMD_NB_GART)) | 226 | if (!amd_nb_has_feature(AMD_NB_GART)) |
227 | return 0; | 227 | return; |
228 | |||
229 | flush_words = kmalloc(amd_nb_num() * sizeof(u32), GFP_KERNEL); | ||
230 | if (!flush_words) { | ||
231 | amd_northbridges.flags &= ~AMD_NB_GART; | ||
232 | return -ENOMEM; | ||
233 | } | ||
234 | 228 | ||
235 | for (i = 0; i != amd_nb_num(); i++) | 229 | flush_words = kmalloc(amd_nb_num() * sizeof(u32), GFP_KERNEL); |
236 | pci_read_config_dword(node_to_amd_nb(i)->misc, 0x9c, | 230 | if (!flush_words) { |
237 | &flush_words[i]); | 231 | amd_northbridges.flags &= ~AMD_NB_GART; |
232 | pr_notice("Cannot initialize GART flush words, GART support disabled\n"); | ||
233 | return; | ||
234 | } | ||
238 | 235 | ||
239 | return 0; | 236 | for (i = 0; i != amd_nb_num(); i++) |
237 | pci_read_config_dword(node_to_amd_nb(i)->misc, 0x9c, &flush_words[i]); | ||
240 | } | 238 | } |
241 | 239 | ||
242 | void amd_flush_garts(void) | 240 | void amd_flush_garts(void) |
@@ -278,17 +276,10 @@ EXPORT_SYMBOL_GPL(amd_flush_garts); | |||
278 | 276 | ||
279 | static __init int init_amd_nbs(void) | 277 | static __init int init_amd_nbs(void) |
280 | { | 278 | { |
281 | int err = 0; | 279 | amd_cache_northbridges(); |
280 | amd_cache_gart(); | ||
282 | 281 | ||
283 | err = amd_cache_northbridges(); | 282 | return 0; |
284 | |||
285 | if (err < 0) | ||
286 | pr_notice("Cannot enumerate AMD northbridges\n"); | ||
287 | |||
288 | if (amd_cache_gart() < 0) | ||
289 | pr_notice("Cannot initialize GART flush words, GART support disabled\n"); | ||
290 | |||
291 | return err; | ||
292 | } | 283 | } |
293 | 284 | ||
294 | /* This has to go after the PCI subsystem */ | 285 | /* This has to go after the PCI subsystem */ |
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; |
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 9b2ef248788d..67ec58f9ef99 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
@@ -1055,7 +1055,7 @@ static const struct idle_cpu idle_cpu_dnv = { | |||
1055 | static const struct x86_cpu_id intel_idle_ids[] __initconst = { | 1055 | static const struct x86_cpu_id intel_idle_ids[] __initconst = { |
1056 | ICPU(INTEL_FAM6_NEHALEM_EP, idle_cpu_nehalem), | 1056 | ICPU(INTEL_FAM6_NEHALEM_EP, idle_cpu_nehalem), |
1057 | ICPU(INTEL_FAM6_NEHALEM, idle_cpu_nehalem), | 1057 | ICPU(INTEL_FAM6_NEHALEM, idle_cpu_nehalem), |
1058 | ICPU(INTEL_FAM6_WESTMERE2, idle_cpu_nehalem), | 1058 | ICPU(INTEL_FAM6_NEHALEM_G, idle_cpu_nehalem), |
1059 | ICPU(INTEL_FAM6_WESTMERE, idle_cpu_nehalem), | 1059 | ICPU(INTEL_FAM6_WESTMERE, idle_cpu_nehalem), |
1060 | ICPU(INTEL_FAM6_WESTMERE_EP, idle_cpu_nehalem), | 1060 | ICPU(INTEL_FAM6_WESTMERE_EP, idle_cpu_nehalem), |
1061 | ICPU(INTEL_FAM6_NEHALEM_EX, idle_cpu_nehalem), | 1061 | ICPU(INTEL_FAM6_NEHALEM_EX, idle_cpu_nehalem), |