summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-05-11 13:35:47 +0300
committerAvi Kivity <avi@redhat.com>2009-06-10 11:48:57 +0300
commitfa9726b0733461781933ab7180aca45e46d0a891 (patch)
treefc9849120d32d73fcb49bca7b0f7c355def7a5c7
parent3298b75c880d6f0fd70750233c0f3e71a72a5bfb (diff)
downloadop-kernel-dev-fa9726b0733461781933ab7180aca45e46d0a891.zip
op-kernel-dev-fa9726b0733461781933ab7180aca45e46d0a891.tar.gz
KVM: Do not allow interrupt injection from userspace if there is a pending event.
The exception will immediately close the interrupt window. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/x86/kvm/x86.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 3244437..96413f4 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -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)
OpenPOWER on IntegriCloud