Skip to content

x86/pmu: Test case optimization, fixes and additions

Sean Christopherson kvm 1 version Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v5 Latest27 patches 6 repliesApplied

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/27x86/pmu: Add PDCM check before accessing PERF_CAP registerlib/x86/processor.h x86/pmu.c x86/pmu_lbr.c+10 -20 replies
2/27x86/pmu: Test emulation instructions on full-width countersx86/pmu.c+3 -30 replies
3/27x86/pmu: Pop up FW prefix to avoid out-of-context propagationx86/pmu.c+1 -00 replies
4/27x86/pmu: Report SKIP when testing Intel LBR on AMD platformsx86/pmu_lbr.c+1 -10 replies
5/27x86/pmu: Fix printed messages for emulated instruction testx86/pmu.c+2 -20 replies
6/27x86/pmu: Introduce __start_event() to drop all of the manual zeroingx86/pmu.c+16 -150 replies
7/27x86/pmu: Introduce multiple_{one, many}() to improve readabilityx86/pmu.c+10 -50 replies
8/27x86/pmu: Reset the expected count of the fixed counter 0 when i386x86/pmu.c+18 -40 replies
9/27x86: create pmu group for quick pmu-scope testingx86/unittests.cfg+2 -00 replies
10/27x86/pmu: Refine info to clarify the current supportx86/pmu.c+1 -10 replies
11/27x86/pmu: Update rdpmc testcase to cover #GP pathlib/x86/processor.h x86/pmu.c+28 -32 replies
12/27x86/pmu: Rename PC_VECTOR to PMI_VECTOR for better readabilityx86/pmu.c+6 -40 replies
13/27x86/pmu: Add lib/x86/pmu.[c.h] and move common code to header fileslib/x86/msr.h lib/x86/pmu.c lib/x86/pmu.h +5 more+112 -980 replies
14/27x86: Add a helper for the BSP's final init sequence common to all flavorslib/x86/asm/setup.h lib/x86/setup.c x86/cstart.S +1 more+11 -90 replies
15/27x86/pmu: Snapshot PMU perf_capabilities during BSP initializationlib/x86/pmu.c lib/x86/pmu.h lib/x86/setup.c +2 more+31 -90 replies
16/27x86/pmu: Snapshot CPUID.0xA PMU capabilities during BSP initializationlib/x86/pmu.c lib/x86/pmu.h+30 -180 replies
17/27x86/pmu: Drop wrappers that just passthrough pmu_caps fieldslib/x86/pmu.h x86/pmu.c x86/pmu_lbr.c+30 -750 replies
18/27x86/pmu: Track GP counter and event select base MSRs in pmu_capslib/x86/pmu.c lib/x86/pmu.h x86/pmu.c+52 -310 replies
19/27x86/pmu: Add helper to get fixed counter MSR indexlib/x86/pmu.h x86/pmu.c+6 -10 replies
20/27x86/pmu: Reset GP and Fixed counters during pmu_init().lib/x86/pmu.c lib/x86/pmu.h+30 -00 replies
21/27x86/pmu: Track global status/control/clear MSRs in pmu_capslib/x86/pmu.c lib/x86/pmu.h x86/pmu.c+25 -180 replies
22/27x86: Add tests for Guest Processor Event Based Sampling (PEBS)lib/x86/msr.h lib/x86/pmu.h x86/Makefile.x86_64 +2 more+477 -00 replies
23/27x86/pmu: Add global helpers to cover Intel Arch PMU Version 1lib/x86/pmu.c lib/x86/pmu.h x86/pmu.c+42 -190 replies
24/27x86/pmu: Add gp_events pointer to route different event tablesx86/pmu.c+12 -70 replies
25/27x86/pmu: Add pmu_caps flag to track if CPU is Intel (versus AMD)lib/x86/pmu.c lib/x86/pmu.h x86/pmu_lbr.c +1 more+8 -20 replies
26/27x86/pmu: Update testcases to cover AMD PMUlib/x86/msr.h lib/x86/pmu.c lib/x86/pmu.h +2 more+114 -342 replies
27/27x86/pmu: Add AMD Guest PerfMonV2 testcaseslib/x86/msr.h lib/x86/pmu.c lib/x86/processor.h+19 -20 replies

Reviews trailers per patch

3 of 27 patches have a Reviewed-by or Acked-by.

PatchSean Christopherson
1/27
2/27
3/27R-b
4/27R-b
5/27
6/27
7/27
8/27
9/27R-b
10/27
11/27
12/27
13/27
14/27
15/27
16/27
17/27
18/27
19/27
20/27
21/27
22/27
23/27
24/27
25/27
26/27
27/27

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [kvm-unit-tests PATCH v5 00/27] x86/pmu: Test case optimization, fixes and additions

This series is a big pile of PMU cleanups and enhancements from Like.

The changes are roughly divided into three parts: (1) fixes (2) cleanups, and (3) new test cases. The changes are bundled in a mega-series as the original, separate series was difficult to review/manage due to a number of dependencies.

There are no major changes in the test logic. The big cleanups are to add lib/x86/pmu.[c,h] and a global PMU capabilities struct to improve readability of the code and to hide some AMD vs. Intel details.

Like's v4 was tested on AMD Zen3/4 and Intel ICX/SPR machines, but this version has only been tested on AMD Zen3 (Milan) and Intel ICX and HSW, i.e. I haven't tested AMD PMU v2 or anything new in SPR (if there is anything in SPR?).

Like Xu (22):
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: Snapshot PMU perf_capabilities during BSP initialization x86/pmu: Track GP counter and event select base MSRs in pmu_caps x86/pmu: Add helper to get fixed counter MSR index x86/pmu: Track global status/control/clear MSRs in pmu_caps
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: Update testcases to cover AMD PMU
x86/pmu: Add AMD Guest PerfMonV2 testcases

Sean Christopherson (5):
x86: Add a helper for the BSP's final init sequence common to all
flavors
x86/pmu: Snapshot CPUID.0xA PMU capabilities during BSP initialization x86/pmu: Drop wrappers that just passthrough pmu_caps fields x86/pmu: Reset GP and Fixed counters during pmu_init(). x86/pmu: Add pmu_caps flag to track if CPU is Intel (versus AMD)

 lib/x86/asm/setup.h |   1 +
 lib/x86/msr.h       |  30 +++
 lib/x86/pmu.c       |  67 +++++++
 lib/x86/pmu.h       | 187 +++++++++++++++++++
 lib/x86/processor.h |  80 ++------
 lib/x86/setup.c     |  13 +-
 x86/Makefile.common |   1 +
 x86/Makefile.x86_64 |   1 +
 x86/cstart.S        |   4 +-
 x86/cstart64.S      |   4 +-
 x86/pmu.c           | 360 ++++++++++++++++++++----------------
 x86/pmu_lbr.c       |  24 +--
 x86/pmu_pebs.c      | 433 ++++++++++++++++++++++++++++++++++++++++++++
 x86/unittests.cfg   |  10 +
 x86/vmx_tests.c     |   1 +
 15 files changed, 975 insertions(+), 241 deletions(-)
 create mode 100644 lib/x86/pmu.c
 create mode 100644 lib/x86/pmu.h
 create mode 100644 x86/pmu_pebs.c

base-commit: 73d9d850f1c2c9f0df321967e67acda0d2c305ea

Signature · 1 line
2.38.1.431.g37b22c650d-goog