Skip to content

Commit 8b703a4

Browse files
committed
KVM: x86: Account fastpath-only VM-Exits in vCPU stats
Increment vcpu->stat.exits when handling a fastpath VM-Exit without going through any part of the "slow" path. Not bumping the exits stat can result in wildly misleading exit counts, e.g. if the primary reason the guest is exiting is to program the TSC deadline timer. Fixes: 404d5d7 ("KVM: X86: Introduce more exit_fastpath_completion enum values") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230602011920.787844-2-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent b2ce899 commit 8b703a4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/kvm/x86.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10758,6 +10758,9 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
1075810758
exit_fastpath = EXIT_FASTPATH_EXIT_HANDLED;
1075910759
break;
1076010760
}
10761+
10762+
/* Note, VM-Exits that go down the "slow" path are accounted below. */
10763+
++vcpu->stat.exits;
1076110764
}
1076210765

1076310766
/*

0 commit comments

Comments
 (0)