KVM: selftests: Test PMC virtualization with forced emulation
authorSean Christopherson <seanjc@google.com>
Tue, 9 Jan 2024 23:02:46 +0000 (15:02 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 30 Jan 2024 23:29:44 +0000 (15:29 -0800)
commitcd34fd8c758e968aae15944b1679c974af719648
treeae59ef4e50abddc4143ccc72a350cb4996678cd7
parent00856e17da730299205270234cda30628ae53b92
KVM: selftests: Test PMC virtualization with forced emulation

Extend the PMC counters test to use forced emulation to verify that KVM
emulates counter events for instructions retired and branches retired.
Force emulation for only a subset of the measured code to test that KVM
does the right thing when mixing perf events with emulated events.

Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Tested-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20240109230250.424295-27-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86_64/pmu_counters_test.c