This is a note to let you know that I've just added the patch titled KVM: x86: Account fastpath-only VM-Exits in vCPU stats to the 6.3-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: kvm-x86-account-fastpath-only-vm-exits-in-vcpu-stats.patch and it can be found in the queue-6.3 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 8b703a49c9df5e74870381ad7ba9c85d8a74ed2c Mon Sep 17 00:00:00 2001 From: Sean Christopherson <seanjc@xxxxxxxxxx> Date: Thu, 1 Jun 2023 18:19:19 -0700 Subject: KVM: x86: Account fastpath-only VM-Exits in vCPU stats From: Sean Christopherson <seanjc@xxxxxxxxxx> commit 8b703a49c9df5e74870381ad7ba9c85d8a74ed2c upstream. 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: 404d5d7bff0d ("KVM: X86: Introduce more exit_fastpath_completion enum values") Cc: stable@xxxxxxxxxxxxxxx Link: https://lore.kernel.org/r/20230602011920.787844-2-seanjc@xxxxxxxxxx Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/x86/kvm/x86.c | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -10682,6 +10682,9 @@ static int vcpu_enter_guest(struct kvm_v exit_fastpath = EXIT_FASTPATH_EXIT_HANDLED; break; } + + /* Note, VM-Exits that go down the "slow" path are accounted below. */ + ++vcpu->stat.exits; } /* Patches currently in stable-queue which might be from seanjc@xxxxxxxxxx are queue-6.3/kvm-x86-bail-from-kvm_recalculate_phys_map-if-x2apic-id-is-out-of-bounds.patch queue-6.3/kvm-x86-account-fastpath-only-vm-exits-in-vcpu-stats.patch queue-6.3/kvm-x86-mmu-grab-memslot-for-correct-address-space-in-nx-recovery-worker.patch