selftests: kvm/x86: Add test for KVM_SET_PMU_EVENT_FILTER
authorJim Mattson <jmattson@google.com>
Sat, 15 Jan 2022 05:24:31 +0000 (21:24 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 19 Jan 2022 17:12:16 +0000 (12:12 -0500)
commitbef9a701f3ebfb60da259b04778d24128505a96c
tree26776a47c3dc2e0057212c0a635a0658c28e26bd
parent2ba9047424fc7243c63ac57f5fdfa754aa895e3c
selftests: kvm/x86: Add test for KVM_SET_PMU_EVENT_FILTER

Verify that the PMU event filter works as expected.

Note that the virtual PMU doesn't work as expected on AMD Zen CPUs (an
intercepted rdmsr is counted as a retired branch instruction), but the
PMU event filter does work.

Signed-off-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220115052431.447232-7-jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/.gitignore
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c [new file with mode: 0644]