From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [PATCH] x86: fix mwait_play_dead() faulting on mwait-incapable cpus Date: Mon, 30 May 2011 08:23:57 -0400 Message-ID: <1306758237-9327-1-git-send-email-avi@redhat.com> References: <201105301143.p4UBhco4001230@demeter2.kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Christoph Lameter , linux-kernel@vger.kernel.org To: Ingo Molnar , "H. Peter Anvin" , =?UTF-8?q?T=C3=B6r=C3=B6k=20Edwin?= Return-path: In-Reply-To: <201105301143.p4UBhco4001230@demeter2.kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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. =46ixes: https://bugzilla.kernel.org/show_bug.cgi?id=3D36222 Reported-by: T=C3=B6r=C3=B6k Edwin Signed-off-by: Avi Kivity --- arch/x86/kernel/smpboot.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index eefd967..33a0c11 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1332,7 +1332,7 @@ static inline void mwait_play_dead(void) void *mwait_ptr; struct cpuinfo_x86 *c =3D __this_cpu_ptr(&cpu_info); =20 - 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; --=20 1.7.5.3