KVM: nSVM: Move SMI vmexit handling to svm_check_nested_events()
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Apr 2020 12:17:28 +0000 (08:17 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 May 2020 16:14:38 +0000 (12:14 -0400)
commit55714cddbf1028bbfa19fd7d69182de3f135ce99
tree30008edbeb26ad9c600a072b1177dca875f21e82
parentbbdad0b5a708ddb37a9f051504c2133fa92df97a
KVM: nSVM: Move SMI vmexit handling to svm_check_nested_events()

Unlike VMX, SVM allows a hypervisor to take a SMI vmexit without having
any special SMM-monitor enablement sequence.  Therefore, it has to be
handled like interrupts and NMIs.  Check for an unblocked SMI in
svm_check_nested_events() so that pending SMIs are correctly prioritized
over IRQs and NMIs when the latter events will trigger VM-Exit.

Note that there is no need to test explicitly for SMI vmexits, because
guests always runs outside SMM and therefore can never get an SMI while
they are blocked.

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