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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Dec 2020 07:51:46 +0000 (08:51 +0100)
commit852bdfb9ab42b2733aa9894c1ebc52fc54863fc3
treedd26d717ecc9555cef3f2957ec51cc738c18e1ad
parentc8a286a793973b0a3dbfce5fd906b88756e98a47
KVM: x86: handle !lapic_in_kernel case in kvm_cpu_*_extint

commit 72c3bcdcda494cbd600712a32e67702cdee60c07 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/irq.c
arch/x86/kvm/lapic.c