diff options
Diffstat (limited to 'arch/x86/kernel/process_32.c')
-rw-r--r-- | arch/x86/kernel/process_32.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 69a69c3f43bb..9f45a51af968 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -285,9 +285,17 @@ static void mwait_idle(void) | |||
285 | mwait_idle_with_hints(0, 0); | 285 | mwait_idle_with_hints(0, 0); |
286 | } | 286 | } |
287 | 287 | ||
288 | static int mwait_usable(const struct cpuinfo_x86 *c) | ||
289 | { | ||
290 | if (force_mwait) | ||
291 | return 1; | ||
292 | /* Any C1 states supported? */ | ||
293 | return c->cpuid_level >= 5 && ((cpuid_edx(5) >> 4) & 0xf) > 0; | ||
294 | } | ||
295 | |||
288 | void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) | 296 | void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) |
289 | { | 297 | { |
290 | if (cpu_has(c, X86_FEATURE_MWAIT)) { | 298 | if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) { |
291 | printk("monitor/mwait feature present.\n"); | 299 | printk("monitor/mwait feature present.\n"); |
292 | /* | 300 | /* |
293 | * Skip, if setup has overridden idle. | 301 | * Skip, if setup has overridden idle. |