]> 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)
commitaf1daf09d90d5126c5da75fa46a42eb926abe9e9
tree7bc04aa69fde69d85d83112eee7c17993dd948b3
parenta903874ebbf841caae22bd1a03b607e7e8214269
kvm: nVMX: fix entry with pending interrupt if APICv is enabled

Commit 4a70038c3bb562dd3a423725dcab7a30d0e9b27e 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: 4a70038c3bb562dd3a423725dcab7a30d0e9b27e
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