public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] kvm: x86/pmu: Introduce and test masked events
@ 2022-07-09  1:17 Aaron Lewis
  2022-07-09  1:17 ` [PATCH v3 1/5] kvm: x86/pmu: Introduce masked events to the pmu event filter Aaron Lewis
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Aaron Lewis @ 2022-07-09  1:17 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, jmattson, seanjc, Aaron Lewis

This series introduces the concept of masked events to the pmu event
filter. Masked events can help reduce the number of events needed in the
events field of a pmu_event_filter by allowing a more generic matching
method to be used for the unit mask when filtering guest events in the
pmu.  With masked events, if an eventsel should be restricted from the
guest, instead of having to add a new eventsel for every unit mask, one
encoded event can be added that matches all possible unit masks.

v1 -> v2
 - Made has_invalid_event() static to fix warning.
 - Fixed checkpatch.pl errors and warnings.
 - Updated to account for KVM_X86_PMU_OP().

v2 -> v3
 - Reworked and documented the invert flag usage.  It was possible to
   get ambiguous results when using it.  That should not be possible
   now.
 - Added testing for inverted masked events to validate the updated
   implementation.
 - Removed testing for inverted masked events from the masked events test.
   They were meaningless with the updated implementation.  More meaning
   tests were added separately.

Aaron Lewis (5):
  kvm: x86/pmu: Introduce masked events to the pmu event filter
  selftests: kvm/x86: Add flags when creating a pmu event filter
  selftests: kvm/x86: Add testing for masked events
  selftests: kvm/x86: Add testing for inverted masked events
  selftests: kvm/x86: Add testing for KVM_SET_PMU_EVENT_FILTER

 Documentation/virt/kvm/api.rst                |  52 ++++-
 arch/x86/include/asm/kvm-x86-pmu-ops.h        |   1 +
 arch/x86/include/uapi/asm/kvm.h               |   8 +
 arch/x86/kvm/pmu.c                            | 135 +++++++++++-
 arch/x86/kvm/pmu.h                            |   1 +
 arch/x86/kvm/svm/pmu.c                        |  12 +
 arch/x86/kvm/vmx/pmu_intel.c                  |  12 +
 .../kvm/x86_64/pmu_event_filter_test.c        | 208 +++++++++++++++++-
 8 files changed, 407 insertions(+), 22 deletions(-)

-- 
2.37.0.144.g8ac04bfd2-goog


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-08-11  0:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-09  1:17 [PATCH v3 0/5] kvm: x86/pmu: Introduce and test masked events Aaron Lewis
2022-07-09  1:17 ` [PATCH v3 1/5] kvm: x86/pmu: Introduce masked events to the pmu event filter Aaron Lewis
2022-08-03  0:19   ` Jim Mattson
2022-08-03 12:28     ` Jim Mattson
2022-08-04  1:36     ` Aaron Lewis
2022-08-04 16:41       ` Jim Mattson
2022-08-04 16:26   ` Sean Christopherson
2022-08-04 16:29     ` Sean Christopherson
2022-08-11  0:08     ` Aaron Lewis
2022-07-09  1:17 ` [PATCH v3 2/5] selftests: kvm/x86: Add flags when creating a " Aaron Lewis
2022-07-09  1:17 ` [PATCH v3 4/5] selftests: kvm/x86: Add testing for inverted masked events Aaron Lewis
2022-07-09  1:17 ` [PATCH v3 5/5] selftests: kvm/x86: Add testing for KVM_SET_PMU_EVENT_FILTER Aaron Lewis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox