This started out as a simple change to sort the (up to 300 element) PMU filtered event list and to use binary search rather than linear search to see if an event is in the list. I thought it would be nice to add a directed test for the PMU event filter, and that's when things got complicated. The Intel side was fine, but the AMD side was a bit ugly, until I did a few refactorings. Imagine my dismay when I discovered that the PMU event filter works fine on the AMD side, but that fundamental PMU virtualization is broken. Jim Mattson (6): KVM: x86/pmu: Use binary search to check filtered events selftests: kvm/x86: Parameterize the CPUID vendor string check selftests: kvm/x86: Introduce is_amd_cpu() selftests: kvm/x86: Export x86_family() for use outside of processor.c selftests: kvm/x86: Introduce x86_model() selftests: kvm/x86: Add test for KVM_SET_PMU_EVENT_FILTER arch/x86/kvm/pmu.c | 30 +- tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + .../selftests/kvm/include/x86_64/processor.h | 18 + .../selftests/kvm/lib/x86_64/processor.c | 36 +- .../kvm/x86_64/pmu_event_filter_test.c | 310 ++++++++++++++++++ 6 files changed, 363 insertions(+), 33 deletions(-) create mode 100644 tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c -- 2.34.1.575.g55b058a8bb-goog