]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: nVMX: fix entry with pending interrupt if APICv is enabled
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 3 Oct 2018 11:44:26 +0000 (13:44 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Oct 2018 15:10:40 +0000 (17:10 +0200)
commit4c1bf45a1f3bbb291e36785ec6044fe514c5f614
tree7bc04aa69fde69d85d83112eee7c17993dd948b3
parent990e3c0381a49ff116238a5a488f1bc72136effd
kvm: nVMX: fix entry with pending interrupt if APICv is enabled

Commit 26d41996f3254742160b8e05db32f22439c14c35 introduced a check on
the interrupt-window and NMI-window CPU execution controls in order to
inject an external interrupt vmexit before the first guest instruction
executes.  However, when APIC virtualization is enabled the host does not
need a vmexit in order to inject an interrupt at the next interrupt window;
instead, it just places the interrupt vector in RVI and the processor will
inject it as soon as possible.  Therefore, on machines with APICv it is
not enough to check the CPU execution controls: the same scenario can also
happen if RVI>vPPR.

Fixes: 26d41996f3254742160b8e05db32f22439c14c35
Reviewed-by: Nikita Leshchenko <nikita.leshchenko@oracle.com>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Liran Alon <liran.alon@oracle.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c