KVM: selftests: Add pmu.h and lib/pmu.c for common PMU assets
authorJinrong Liang <cloudliang@tencent.com>
Tue, 9 Jan 2024 23:02:35 +0000 (15:02 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 30 Jan 2024 23:29:18 +0000 (15:29 -0800)
commite6faa04970575622243d3a20782dde2d5813772d
treeaa92edf9ccb876c979c7359f234083c33f659339
parent370d536322896cc9ad59eb8849ad8e1f9e985953
KVM: selftests: Add pmu.h and lib/pmu.c for common PMU assets

Add a PMU library for x86 selftests to help eliminate open-coded event
encodings, and to reduce the amount of copy+paste between PMU selftests.

Use the new common macro definitions in the existing PMU event filter test.

Cc: Aaron Lewis <aaronlewis@google.com>
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Jinrong Liang <cloudliang@tencent.com>
Co-developed-by: Sean Christopherson <seanjc@google.com>
Tested-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20240109230250.424295-16-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/include/x86_64/pmu.h [new file with mode: 0644]
tools/testing/selftests/kvm/lib/x86_64/pmu.c [new file with mode: 0644]
tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c