x86: Fix mwait_play_dead() faulting on mwait-incapable cpus
authorAvi Kivity <[email protected]>
Mon, 30 May 2011 12:23:57 +0000 (08:23 -0400)
committerIngo Molnar <[email protected]>
Mon, 30 May 2011 12:37:54 +0000 (14:37 +0200)
A logic error in mwait_play_dead() causes the kernel to use
mwait even on cpus which don't support it, such as KVM virtual
cpus.

Introduced by:

  349c004e3d31: x86: A fast way to check capabilities of the current cpu

Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=36222
Reported-by: Török Edwin <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Tejun Heo <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/kernel/smpboot.c

index eefd96765e79a1c7ded62bd86c9d2c5da8c95062..33a0c11797de758004b399225eec21db5a1e932e 100644 (file)
@@ -1332,7 +1332,7 @@ static inline void mwait_play_dead(void)
        void *mwait_ptr;
        struct cpuinfo_x86 *c = __this_cpu_ptr(&cpu_info);
 
-       if (!this_cpu_has(X86_FEATURE_MWAIT) && mwait_usable(c))
+       if (!(this_cpu_has(X86_FEATURE_MWAIT) && mwait_usable(c)))
                return;
        if (!this_cpu_has(X86_FEATURE_CLFLSH))
                return;