aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-05-11 06:35:47 -0400
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:57 -0400
commitfa9726b0733461781933ab7180aca45e46d0a891 (patch)
treefc9849120d32d73fcb49bca7b0f7c355def7a5c7 /arch/x86/kvm/x86.c
parent3298b75c880d6f0fd70750233c0f3e71a72a5bfb (diff)
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>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-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 3244437e67b3..96413f4e33ba 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,
3105 kvm_run->ready_for_interrupt_injection = 1; 3105 kvm_run->ready_for_interrupt_injection = 1;
3106 else 3106 else
3107 kvm_run->ready_for_interrupt_injection = 3107 kvm_run->ready_for_interrupt_injection =
3108 (kvm_arch_interrupt_allowed(vcpu) && 3108 kvm_arch_interrupt_allowed(vcpu) &&
3109 !kvm_cpu_has_interrupt(vcpu)); 3109 !kvm_cpu_has_interrupt(vcpu) &&
3110 !kvm_event_needs_reinjection(vcpu);
3110} 3111}
3111 3112
3112static void vapic_enter(struct kvm_vcpu *vcpu) 3113static void vapic_enter(struct kvm_vcpu *vcpu)