KVM: selftests: Test the PMU event "Instructions retired"
authorAaron Lewis <aaronlewis@google.com>
Fri, 7 Apr 2023 23:32:54 +0000 (16:32 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 14 Apr 2023 20:21:38 +0000 (13:21 -0700)
commit457bd7af1a17182e7f1f97eeb5d9107f8699e99d
tree3beeff0f707814152c07a8eb8445859cfc31bfdc
parente9f322bd23960026275014477e21f7a9445fd926
KVM: selftests: Test the PMU event "Instructions retired"

Add testing for the event "Instructions retired" (0xc0) in the PMU
event filter on both Intel and AMD to ensure that the event doesn't
count when it is disallowed.  Unlike most of the other events, the
event "Instructions retired" will be incremented by KVM when an
instruction is emulated.  Test that this case is being properly handled
and that KVM doesn't increment the counter when that event is
disallowed.

Signed-off-by: Aaron Lewis <aaronlewis@google.com>
Link: https://lore.kernel.org/r/20230307141400.1486314-6-aaronlewis@google.com
Link: https://lore.kernel.org/r/20230407233254.957013-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c