kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: VMX: Fix locking order in handle_invalid_guest_state
@ 2009-07-22 21:53 Jan Kiszka
  2009-07-23 21:45 ` Marcelo Tosatti
  0 siblings, 1 reply; 21+ messages in thread
From: Jan Kiszka @ 2009-07-22 21:53 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: kvm-devel

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

Release and re-acquire preemption and IRQ lock in the same order as
vcpu_enter_guest does.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 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_vcpu *vcpu,
 	struct vcpu_vmx *vmx = to_vmx(vcpu);
 	enum emulation_result err = EMULATE_DONE;
 
-	preempt_enable();
 	local_irq_enable();
+	preempt_enable();
 
 	while (!guest_state_valid(vcpu)) {
 		err = emulate_instruction(vcpu, kvm_run, 0, 0, 0);
@@ -3344,8 +3344,8 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
 			schedule();
 	}
 
-	local_irq_disable();
 	preempt_disable();
+	local_irq_disable();
 
 	vmx->invalid_state_emulation_result = err;
 }


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2009-07-30 11:57 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-22 21:53 [PATCH] KVM: VMX: Fix locking order in handle_invalid_guest_state Jan Kiszka
2009-07-23 21:45 ` Marcelo Tosatti
2009-07-24  7:00   ` Jan Kiszka
2009-07-26 13:51     ` Avi Kivity
2009-07-26 14:23       ` Jan Kiszka
2009-07-26 14:36         ` Avi Kivity
2009-07-26 14:38           ` Jan Kiszka
2009-07-26 14:47             ` Avi Kivity
2009-07-26 14:55               ` Jan Kiszka
2009-07-26 15:02                 ` Avi Kivity
2009-07-29 12:24   ` Marcelo Tosatti
2009-07-29 12:44     ` Avi Kivity
2009-07-29 14:07       ` Marcelo Tosatti
2009-07-29 14:32         ` Gleb Natapov
2009-07-30 11:16         ` Avi Kivity
2009-07-30 11:16           ` Gleb Natapov
2009-07-30 11:26             ` Avi Kivity
2009-07-30 11:24               ` Gleb Natapov
2009-07-30 11:46                 ` Avi Kivity
2009-07-30 11:47                   ` Gleb Natapov
2009-07-30 11:57                     ` Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).