From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: [PATCH] KVM: VMX: Fix locking order in handle_invalid_guest_state Date: Wed, 22 Jul 2009 23:53:26 +0200 Message-ID: <4A678A56.7050901@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigE0A5D60E33F0EB2C8BA7F600" Cc: kvm-devel To: Marcelo Tosatti Return-path: Received: from fmmailgate02.web.de ([217.72.192.227]:35590 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752719AbZGVVx2 (ORCPT ); Wed, 22 Jul 2009 17:53:28 -0400 Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE0A5D60E33F0EB2C8BA7F600 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Release and re-acquire preemption and IRQ lock in the same order as vcpu_enter_guest does. Signed-off-by: Jan Kiszka --- arch/x86/kvm/vmx.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d75c271..4f914c3 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3324,8 +3324,8 @@ static void handle_invalid_guest_state(struct kvm_v= cpu *vcpu, struct vcpu_vmx *vmx =3D to_vmx(vcpu); enum emulation_result err =3D EMULATE_DONE; =20 - preempt_enable(); local_irq_enable(); + preempt_enable(); =20 while (!guest_state_valid(vcpu)) { err =3D emulate_instruction(vcpu, kvm_run, 0, 0, 0); @@ -3344,8 +3344,8 @@ static void handle_invalid_guest_state(struct kvm_v= cpu *vcpu, schedule(); } =20 - local_irq_disable(); preempt_disable(); + local_irq_disable(); =20 vmx->invalid_state_emulation_result =3D err; } --------------enigE0A5D60E33F0EB2C8BA7F600 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkpnilYACgkQniDOoMHTA+n2XQCeLs37iUdDNGhvo6dtdT6c5p+U AUMAnR+EAyEyrf6cSE79ws9Ti6470Yta =cmuA -----END PGP SIGNATURE----- --------------enigE0A5D60E33F0EB2C8BA7F600--