All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] KVM: x86/pmu: Use binary search to check filtered events
@ 2022-01-14  1:21 Jim Mattson
  2022-01-14  1:21 ` [PATCH v2 1/6] " Jim Mattson
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Jim Mattson @ 2022-01-14  1:21 UTC (permalink / raw)
  To: kvm, pbonzini, like.xu.linux, daviddunn, cloudliang; +Cc: Jim Mattson

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. And I don't just mean erratum 1292, though
that throws even more brokenness into the mix.

v1 -> v2
* Drop the check for "AMDisbetter!" in is_amd_cpu() [David Dunn]
* Drop the call to cpuid(0, 0) that fed the original check for
  CPU vendor string "AuthenticAMD" in vm_compute_max_gfn().
* Simplify the inline asm in the selftest by using the compound literal
  for both input & output.
  
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      |  40 +--
 .../kvm/x86_64/pmu_event_filter_test.c        | 306 ++++++++++++++++++
 6 files changed, 361 insertions(+), 35 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c

-- 
2.34.1.703.g22d0c6ccf7-goog


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

end of thread, other threads:[~2022-01-18  9:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-14  1:21 [PATCH v2 0/6] KVM: x86/pmu: Use binary search to check filtered events Jim Mattson
2022-01-14  1:21 ` [PATCH v2 1/6] " Jim Mattson
2022-01-14  1:21 ` [PATCH v2 2/6] selftests: kvm/x86: Parameterize the CPUID vendor string check Jim Mattson
2022-01-14  1:21 ` [PATCH v2 3/6] selftests: kvm/x86: Introduce is_amd_cpu() Jim Mattson
2022-01-14  1:21 ` [PATCH v2 4/6] selftests: kvm/x86: Export x86_family() for use outside of processor.c Jim Mattson
2022-01-14  1:21 ` [PATCH v2 5/6] selftests: kvm/x86: Introduce x86_model() Jim Mattson
2022-01-14  1:21 ` [PATCH v2 6/6] selftests: kvm/x86: Add test for KVM_SET_PMU_EVENT_FILTER Jim Mattson
2022-01-14 19:15   ` David Dunn
2022-01-15  5:01     ` Jim Mattson
2022-01-18  9:15 ` [PATCH v2 0/6] KVM: x86/pmu: Use binary search to check filtered events Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.