]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
KVM: Do not allow interrupt injection from userspace if there is a pending event.
authorGleb Natapov <gleb@redhat.com>
Mon, 11 May 2009 10:35:47 +0000 (13:35 +0300)
committerAvi Kivity <avi@redhat.com>
Wed, 10 Jun 2009 08:48:57 +0000 (11:48 +0300)
The exception will immediately close the interrupt window.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/x86.c

index 3244437e67b35aa61dddfc84b944a0a565cb4435..96413f4e33bab473c551a1f23f2234b108bd97c1 100644 (file)
@@ -3105,8 +3105,9 @@ static void post_kvm_run_save(struct kvm_vcpu *vcpu,
                kvm_run->ready_for_interrupt_injection = 1;
        else
                kvm_run->ready_for_interrupt_injection =
-                                       (kvm_arch_interrupt_allowed(vcpu) &&
-                                        !kvm_cpu_has_interrupt(vcpu));
+                       kvm_arch_interrupt_allowed(vcpu) &&
+                       !kvm_cpu_has_interrupt(vcpu) &&
+                       !kvm_event_needs_reinjection(vcpu);
 }
 
 static void vapic_enter(struct kvm_vcpu *vcpu)