]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nSVM: clear events pending from svm_complete_interrupts() when exiting to L1
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 7 Jan 2019 18:44:51 +0000 (19:44 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Jan 2019 18:11:35 +0000 (19:11 +0100)
commit16fe5954a65e9f3bd1fcc643c364ecf6918f2cce
tree532cd8af8f04b7641db81b860e589ab483517e9e
parent1e20ef4a9b4b5048f04b78031066decb9ebd7a7c
KVM: nSVM: clear events pending from svm_complete_interrupts() when exiting to L1

kvm-unit-tests' eventinj "NMI failing on IDT" test results in NMI being
delivered to the host (L1) when it's running nested. The problem seems to
be: svm_complete_interrupts() raises 'nmi_injected' flag but later we
decide to reflect EXIT_NPF to L1. The flag remains pending and we do NMI
injection upon entry so it got delivered to L1 instead of L2.

It seems that VMX code solves the same issue in prepare_vmcs12(), this was
introduced with code refactoring in commit c69f4060ea7b ("KVM: nVMX: Rework
event injection and recovery").

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c