]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Fix loss of pending IRQ/NMI before entering L2
authorLiran Alon <liran.alon@oracle.com>
Mon, 3 Sep 2018 12:20:22 +0000 (15:20 +0300)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 7 Sep 2018 16:38:42 +0000 (18:38 +0200)
commit26d41996f3254742160b8e05db32f22439c14c35
treeea1ffadf64f634333a2b12faa52785b181197214
parentd12de3bb7155467d769cedc82f2b6a30eba5a6c8
KVM: nVMX: Fix loss of pending IRQ/NMI before entering L2

Consider the case L1 had a IRQ/NMI event until it executed
VMLAUNCH/VMRESUME which wasn't delivered because it was disallowed
(e.g. interrupts disabled). When L1 executes VMLAUNCH/VMRESUME,
L0 needs to evaluate if this pending event should cause an exit from
L2 to L1 or delivered directly to L2 (e.g. In case L1 don't intercept
EXTERNAL_INTERRUPT).

Usually this would be handled by L0 requesting a IRQ/NMI window
by setting VMCS accordingly. However, this setting was done on
VMCS01 and now VMCS02 is active instead. Thus, when L1 executes
VMLAUNCH/VMRESUME we force L0 to perform pending event evaluation by
requesting a KVM_REQ_EVENT.

Note that above scenario exists when L1 KVM is about to enter L2 but
requests an "immediate-exit". As in this case, L1 will
disable-interrupts and then send a self-IPI before entering L2.

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