KVM: x86: unify handling of interrupt window
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 30 Jul 2015 08:32:16 +0000 (10:32 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 1 Oct 2015 13:06:26 +0000 (15:06 +0200)
commit4ca7dd8ce4b24e18f94eed90e80c6eb80fb48c9a
treefb8243091752aefe94cdb358f725c927ec71fe42
parent35754c987f252e859bfa390a6816e85563afe79d
KVM: x86: unify handling of interrupt window

The interrupt window is currently checked twice, once in vmx.c/svm.c and
once in dm_request_for_irq_injection.  The only difference is the extra
check for kvm_arch_interrupt_allowed in dm_request_for_irq_injection,
and the different return value (EINTR/KVM_EXIT_INTR for vmx.c/svm.c vs.
0/KVM_EXIT_IRQ_WINDOW_OPEN for dm_request_for_irq_injection).

However, dm_request_for_irq_injection is basically dead code!  Revive it
by removing the checks in vmx.c and svm.c's vmexit handlers, and
fixing the returned values for the dm_request_for_irq_injection case.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c