]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: x86: mark synthetic SMM vmexit as SVM_EXIT_SW
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 1 Mar 2022 13:55:23 +0000 (15:55 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Mar 2022 16:29:18 +0000 (11:29 -0500)
Use a dummy unused vmexit reason to mark the 'VM exit' that is happening
when kvm exits to handle SMM, which is not a real VM exit.

This makes it a bit easier to read the KVM trace, and avoids
other potential problems due to a stale vmexit reason in the vmcb.
If SVM_EXIT_SW somehow reaches svm_invoke_exit_handler(), instead,
svm_check_exit_valid() will return false and a WARN will be logged.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20220301135526.136554-2-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c

index e7e5084908a77f3017656c15e175941a215dcd11..b069493ad5c7211aaad934ea9614235c4355f4e3 100644 (file)
@@ -4240,7 +4240,7 @@ static int svm_enter_smm(struct kvm_vcpu *vcpu, char *smstate)
        svm->vmcb->save.rsp = vcpu->arch.regs[VCPU_REGS_RSP];
        svm->vmcb->save.rip = vcpu->arch.regs[VCPU_REGS_RIP];
 
-       ret = nested_svm_vmexit(svm);
+       ret = nested_svm_simple_vmexit(svm, SVM_EXIT_SW);
        if (ret)
                return ret;