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>
This commit is contained in:
@@ -378,6 +378,11 @@ static inline bool svm_nested_virtualize_tpr(struct kvm_vcpu *vcpu)
|
||||
return is_guest_mode(vcpu) && (vcpu->arch.hflags & HF_VINTR_MASK);
|
||||
}
|
||||
|
||||
static inline bool nested_exit_on_smi(struct vcpu_svm *svm)
|
||||
{
|
||||
return (svm->nested.intercept & (1ULL << INTERCEPT_SMI));
|
||||
}
|
||||
|
||||
static inline bool nested_exit_on_nmi(struct vcpu_svm *svm)
|
||||
{
|
||||
return (svm->nested.intercept & (1ULL << INTERCEPT_NMI));
|
||||
|
Reference in New Issue
Block a user