All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH v4 00/24] x86/pmu: Test case optimization, fixes and additions
@ 2022-10-24  9:11 Like Xu
  2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 01/24] x86/pmu: Add PDCM check before accessing PERF_CAP register Like Xu
                   ` (24 more replies)
  0 siblings, 25 replies; 35+ messages in thread
From: Like Xu @ 2022-10-24  9:11 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: Paolo Bonzini, Jim Mattson, kvm

The patch set includes all the changes on my side (SPR PEBS and AMD
PerfMonV2 are included, except for Arch lbr), which helps to keep the
review time focused. 

There are no major changes in the test logic. A considerable number of
helpers have been added to lib/x86/pmu.[c,h], which really helps the
readability of the code, while hiding some hardware differentiation details.

These are divided into three parts, the first part (01 - 08) is bug fixing,
the second part (09 - 18) is code refactoring, and the third part is the
addition of new test cases. It may also be good to split up and merge
in sequence. They get passed on AMD Zen3/4, Intel ICX/SPR machines.

Please feel free to test them in your own CI environment.

v3: https://lore.kernel.org/kvm/20220819110939.78013-1-likexu@tencent.com/
v3 -> v4 Changelog:
- Add more helpers to the new lib/x86/pmu.h and lib/x86/pmu.c;
  (pmu_cap, perf_capabilities other pmu related stuff)
- Refine commit message and report_ messages;
- Code style fixes (curly braces, #defeine, GENMASK_ULL,
  ternary operator);
- Add more message for "the expected init cnt.count for fixed counter 0"
  (measure_for_overflow() is applied);
- Rename PC_VECTOR to PMI_VECTOR;
- Snapshot pebs_has_baseline() to avoid RDMSR on every touch;
- Drop the idea about is_the_count_reproducible() for AMD;
- Add X86_FEATURE_* in the KUT world;

Like Xu (24):
  x86/pmu: Add PDCM check before accessing PERF_CAP register
  x86/pmu: Test emulation instructions on full-width counters
  x86/pmu: Pop up FW prefix to avoid out-of-context propagation
  x86/pmu: Report SKIP when testing Intel LBR on AMD platforms
  x86/pmu: Fix printed messages for emulated instruction test
  x86/pmu: Introduce __start_event() to drop all of the manual zeroing
  x86/pmu: Introduce multiple_{one, many}() to improve readability
  x86/pmu: Reset the expected count of the fixed counter 0 when i386
  x86: create pmu group for quick pmu-scope testing
  x86/pmu: Refine info to clarify the current support
  x86/pmu: Update rdpmc testcase to cover #GP path
  x86/pmu: Rename PC_VECTOR to PMI_VECTOR for better readability
  x86/pmu: Add lib/x86/pmu.[c.h] and move common code to header files
  x86/pmu: Read cpuid(10) in the pmu_init() to reduce VM-Exit
  x86/pmu: Initialize PMU perf_capabilities at pmu_init()
  x86/pmu: Add GP counter related helpers
  x86/pmu: Add GP/Fixed counters reset helpers
  x86/pmu: Add a set of helpers related to global registers
  x86: Add tests for Guest Processor Event Based Sampling (PEBS)
  x86/pmu: Add global helpers to cover Intel Arch PMU Version 1
  x86/pmu: Add gp_events pointer to route different event tables
  x86/pmu: Add nr_gp_counters to limit the number of test counters
  x86/pmu: Update testcases to cover AMD PMU
  x86/pmu: Add AMD Guest PerfMonV2 testcases

 lib/x86/msr.h       |  30 +++
 lib/x86/pmu.c       |  36 ++++
 lib/x86/pmu.h       | 306 +++++++++++++++++++++++++++++++
 lib/x86/processor.h |  80 ++------
 lib/x86/smp.c       |   2 +
 x86/Makefile.common |   1 +
 x86/Makefile.x86_64 |   1 +
 x86/pmu.c           | 297 ++++++++++++++++++------------
 x86/pmu_lbr.c       |  20 +-
 x86/pmu_pebs.c      | 433 ++++++++++++++++++++++++++++++++++++++++++++
 x86/unittests.cfg   |  10 +
 x86/vmx_tests.c     |   1 +
 12 files changed, 1022 insertions(+), 195 deletions(-)
 create mode 100644 lib/x86/pmu.c
 create mode 100644 lib/x86/pmu.h
 create mode 100644 x86/pmu_pebs.c

-- 
2.38.1


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

end of thread, other threads:[~2022-11-02 20:10 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-24  9:11 [kvm-unit-tests PATCH v4 00/24] x86/pmu: Test case optimization, fixes and additions Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 01/24] x86/pmu: Add PDCM check before accessing PERF_CAP register Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 02/24] x86/pmu: Test emulation instructions on full-width counters Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 03/24] x86/pmu: Pop up FW prefix to avoid out-of-context propagation Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 04/24] x86/pmu: Report SKIP when testing Intel LBR on AMD platforms Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 05/24] x86/pmu: Fix printed messages for emulated instruction test Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 06/24] x86/pmu: Introduce __start_event() to drop all of the manual zeroing Like Xu
2022-11-02 17:41   ` Sean Christopherson
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 07/24] x86/pmu: Introduce multiple_{one, many}() to improve readability Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 08/24] x86/pmu: Reset the expected count of the fixed counter 0 when i386 Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 09/24] x86: create pmu group for quick pmu-scope testing Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 10/24] x86/pmu: Refine info to clarify the current support Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 11/24] x86/pmu: Update rdpmc testcase to cover #GP path Like Xu
2022-11-02 17:42   ` Sean Christopherson
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 12/24] x86/pmu: Rename PC_VECTOR to PMI_VECTOR for better readability Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 13/24] x86/pmu: Add lib/x86/pmu.[c.h] and move common code to header files Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 14/24] x86/pmu: Read cpuid(10) in the pmu_init() to reduce VM-Exit Like Xu
2022-11-02 17:45   ` Sean Christopherson
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 15/24] x86/pmu: Initialize PMU perf_capabilities at pmu_init() Like Xu
2022-11-02 17:45   ` Sean Christopherson
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 16/24] x86/pmu: Add GP counter related helpers Like Xu
2022-11-02 17:54   ` Sean Christopherson
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 17/24] x86/pmu: Add GP/Fixed counters reset helpers Like Xu
2022-11-02 17:55   ` Sean Christopherson
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 18/24] x86/pmu: Add a set of helpers related to global registers Like Xu
2022-11-02 17:56   ` Sean Christopherson
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 19/24] x86: Add tests for Guest Processor Event Based Sampling (PEBS) Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 20/24] x86/pmu: Add global helpers to cover Intel Arch PMU Version 1 Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 21/24] x86/pmu: Add gp_events pointer to route different event tables Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 22/24] x86/pmu: Add nr_gp_counters to limit the number of test counters Like Xu
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 23/24] x86/pmu: Update testcases to cover AMD PMU Like Xu
2022-11-02 17:58   ` Sean Christopherson
2022-11-02 20:10     ` Sean Christopherson
2022-10-24  9:12 ` [kvm-unit-tests PATCH v4 24/24] x86/pmu: Add AMD Guest PerfMonV2 testcases Like Xu
2022-11-02 18:35 ` [kvm-unit-tests PATCH v4 00/24] x86/pmu: Test case optimization, fixes and additions Sean Christopherson

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.