[PATCH 0/2] KVM: selftests: Reduce PMC test runtime by ~17x

From: Sean Christopherson

Date: Tue Aug 04 2026 - 13:34:48 EST


Reduce the runtime of the PMU counters test on an Emerald Rapids system from
~85 seconds to ~5 seconds by (a) testing one random GP counter in the arch
events test instead of every GP counter and (b) creating one large VM per
"major" test and then running each subtest with a different vCPUs, versus
creating a new single-vCPU VM for every subtest.

AFAICT, there aren't any bugs anywhere in the VM creation flow, there's just
a lot of work to be done. And VM creation isn't even that slow, but creating
something like 1000+ VMs for the test adds up.

Sean Christopherson (2):
KVM: selftests: Test one random GP counter in PMU arch events testcase
KVM: selftests: Create one VM with many vCPUs for each major PMU
counters test

.../testing/selftests/kvm/include/test_util.h | 4 +-
tools/testing/selftests/kvm/lib/test_util.c | 22 +-
.../selftests/kvm/x86/pmu_counters_test.c | 230 ++++++++++--------
3 files changed, 150 insertions(+), 106 deletions(-)


base-commit: 2dfab80a305700a45bd947350dae253ba4e30c41
--
2.55.0.571.g244d577d93-goog