OSDN Git Service

KVM: selftests: Test masked events in PMU filter
authorAaron Lewis <aaronlewis@google.com>
Tue, 20 Dec 2022 16:12:36 +0000 (16:12 +0000)
committerSean Christopherson <seanjc@google.com>
Tue, 24 Jan 2023 18:06:14 +0000 (10:06 -0800)
commit647ffac11ebbbd21e04dd11a7125decb99eeee65
tree1a3639961850945d9f4e3a967bab57ce0c924bc5
parent7b7027937d0155aaf583afbb9da4311fb5f28dd8
KVM: selftests: Test masked events in PMU filter

Add testing to show that a pmu event can be filtered with a generalized
match on it's unit mask.

These tests set up test cases to demonstrate various ways of filtering
a pmu event that has multiple unit mask values.  It does this by
setting up the filter in KVM with the masked events provided, then
enabling three pmu counters in the guest.  The test then verifies that
the pmu counters agree with which counters should be counting and which
counters should be filtered for both a sparse filter list and a dense
filter list.

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