KVM: selftests: Add a helper to query if the PMU module param is enabled
authorSean Christopherson <seanjc@google.com>
Tue, 9 Jan 2024 23:02:42 +0000 (15:02 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 30 Jan 2024 23:29:41 +0000 (15:29 -0800)
commitc85e986716b03bccfec2e5a577cc1aab4f172ffd
tree304b566b875332d3521a8bafd03e0d08e5c0a4a2
parentb55e7adf633a8a13d5ede57b77509ea8fa157a56
KVM: selftests: Add a helper to query if the PMU module param is enabled

Add a helper to probe KVM's "enable_pmu" param, open coding strings in
multiple places is just asking for false negatives and/or runtime errors
due to typos.

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-23-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/x86_64/pmu_counters_test.c
tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c
tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c