KVM: x86: handle !lapic_in_kernel case in kvm_cpu_*_extint
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 27 Nov 2020 07:53:52 +0000 (08:53 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 27 Nov 2020 14:19:52 +0000 (09:19 -0500)
commit72c3bcdcda494cbd600712a32e67702cdee60c07
tree3fac8966a2b3858de81be7ce9080b53bcc59752c
parent545f63948d3a2d5ad5aa2245c5cc75d5a45c19b4
KVM: x86: handle !lapic_in_kernel case in kvm_cpu_*_extint

Centralize handling of interrupts from the userspace APIC
in kvm_cpu_has_extint and kvm_cpu_get_extint, since
userspace APIC interrupts are handled more or less the
same as ExtINTs are with split irqchip.  This removes
duplicated code from kvm_cpu_has_injectable_intr and
kvm_cpu_has_interrupt, and makes the code more similar
between kvm_cpu_has_{extint,interrupt} on one side
and kvm_cpu_get_{extint,interrupt} on the other.

Cc: stable@vger.kernel.org
Reviewed-by: Filippo Sironi <sironi@amazon.de>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/irq.c
arch/x86/kvm/lapic.c