Skip to content

Commit 791a089

Browse files
committed
KVM: SVM: Invoke trace_kvm_exit() for fastpath VM-Exits
Move SVM's call to trace_kvm_exit() from the "slow" VM-Exit handler to svm_vcpu_run() so that KVM traces fastpath VM-Exits that re-enter the guest without bouncing through the slow path. This bug is benign in the current code base as KVM doesn't currently support any such exits on SVM. Fixes: a9ab13f ("KVM: X86: Improve latency for single target IPI fastpath") Link: https://lore.kernel.org/r/20230602011920.787844-3-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 0d3518d commit 791a089

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/x86/kvm/svm/svm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3405,8 +3405,6 @@ static int svm_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath)
34053405
struct kvm_run *kvm_run = vcpu->run;
34063406
u32 exit_code = svm->vmcb->control.exit_code;
34073407

3408-
trace_kvm_exit(vcpu, KVM_ISA_SVM);
3409-
34103408
/* SEV-ES guests must use the CR write traps to track CR registers. */
34113409
if (!sev_es_guest(vcpu->kvm)) {
34123410
if (!svm_is_intercept(svm, INTERCEPT_CR0_WRITE))
@@ -4132,6 +4130,8 @@ static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu)
41324130
SVM_EXIT_EXCP_BASE + MC_VECTOR))
41334131
svm_handle_mce(vcpu);
41344132

4133+
trace_kvm_exit(vcpu, KVM_ISA_SVM);
4134+
41354135
svm_complete_interrupts(vcpu);
41364136

41374137
if (is_guest_mode(vcpu))

0 commit comments

Comments
 (0)