KVM: selftests: Add PMU feature framework, use in PMU event filter test
authorSean Christopherson <seanjc@google.com>
Thu, 6 Oct 2022 00:51:22 +0000 (00:51 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 17 Nov 2022 00:59:05 +0000 (16:59 -0800)
commit5228c02a4c541a065ec071ea7ec2c1c76f3723dd
tree0fd1008f6b2f8e2700f2ce2e7ccd2e99b3dc0a11
parent4feb9d21a407318129b6ea3a6735f1866439b9ab
KVM: selftests: Add PMU feature framework, use in PMU event filter test

Add an X86_PMU_FEATURE_* framework to simplify probing architectural
events on Intel PMUs, which require checking the length of a bit vector
and the _absence_ of a "feature" bit.  Add helpers for both KVM and
"this CPU", and use the newfangled magic (along with X86_PROPERTY_*)
to  clean up pmu_event_filter_test.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20221006005125.680782-10-seanjc@google.com
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c