diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-05-11 13:35:47 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-06-10 11:48:57 +0300 |
commit | fa9726b0733461781933ab7180aca45e46d0a891 (patch) | |
tree | fc9849120d32d73fcb49bca7b0f7c355def7a5c7 /arch/x86/kvm | |
parent | 3298b75c880d6f0fd70750233c0f3e71a72a5bfb (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')
-rw-r--r-- | arch/x86/kvm/x86.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 3244437e67b..96413f4e33b 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) |