]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: selftests: Test behavior of KVM_X86_DISABLE_EXITS_APERFMPERF
authorJim Mattson <jmattson@google.com>
Thu, 26 Jun 2025 00:12:24 +0000 (17:12 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 9 Jul 2025 16:33:41 +0000 (09:33 -0700)
commitdf98ce784aebdf4b1448ec2abfbbcd8f48b2e295
tree47f0587a0f22cbe5dd8a9f383da15a7994f6eee6
parente83ee6f76c33de80d5fe4cec523e2b95bfc5e3ea
KVM: selftests: Test behavior of KVM_X86_DISABLE_EXITS_APERFMPERF

For a VCPU thread pinned to a single LPU, verify that interleaved host
and guest reads of IA32_[AM]PERF return strictly increasing values when
APERFMPERF exiting is disabled.

Run the test in both L1 and L2 to verify that KVM passes through the
APERF and MPERF MSRs when L1 doesn't want to intercept them (or any MSRs).

Signed-off-by: Jim Mattson <jmattson@google.com>
Link: https://lore.kernel.org/r/20250530185239.2335185-4-jmattson@google.com
Co-developed-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20250626001225.744268-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/Makefile.kvm
tools/testing/selftests/kvm/x86/aperfmperf_test.c [new file with mode: 0644]