X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=arch%2Fx86%2Fkernel%2Fprocess_32.c;h=9f45a51af968be31679923ea94bf83a9e0c60e88;hb=0c07ee38c9d4eb081758f5ad14bbffa7197e1aec;hp=69a69c3f43bb4940c6fa9485b0015debb68f432a;hpb=30d432dfab2bcfd021d352e2058fae6b9405caeb;p=~andy%2Flinux diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 69a69c3f43b..9f45a51af96 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -285,9 +285,17 @@ static void mwait_idle(void) mwait_idle_with_hints(0, 0); } +static int mwait_usable(const struct cpuinfo_x86 *c) +{ + if (force_mwait) + return 1; + /* Any C1 states supported? */ + return c->cpuid_level >= 5 && ((cpuid_edx(5) >> 4) & 0xf) > 0; +} + void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) { - if (cpu_has(c, X86_FEATURE_MWAIT)) { + if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) { printk("monitor/mwait feature present.\n"); /* * Skip, if setup has overridden idle.