Skip to contentSkip to conversation

x86: fix mwait_play_dead() faulting on mwait-incapable cpus

PATCH In review Avi Kivity 2 participants 2 messages May 30, 2011 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Avi Kivity

author
#1 lore raw

PATCH 1/1 x86: fix mwait_play_dead() faulting on mwait-incapable cpus

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 349c004e3d31fd.

---
 arch/x86/kernel/smpboot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/smpboot.c +1 -1
index eefd967..33a0c11 100644
@@ -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;
Signature · 1 line
1.7.5.3
Tested-by on v1 1/1
#2 lore raw
Quoted 6 lines · Avi Kivity

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 349c004e3d31fd.

Confirmed that it fixes it.

Quoted 3 lines

You can add this if you want to:

Thanks,
--Edwin