x86/pmu: Test case optimization, fixes and additions
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest24 patches 10 repliesIn review
- v313 patches 25 repliesSuperseded
- v25 patches 0 repliesSuperseded
Changes in v4 from the cover letter
- 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;
Patches in v4 No applies recorded yet
Reviews trailers per patch
4 of 24 patches have a Reviewed-by or Acked-by.
| Patch | Sean Christopherson | Sandipan Das |
|---|---|---|
| 1/24 | ||
| 2/24 | ||
| 3/24 | R-b | |
| 4/24 | R-b | |
| 5/24 | ||
| 6/24 | ||
| 7/24 | ||
| 8/24 | ||
| 9/24 | R-b | |
| 10/24 | ||
| 11/24 | ||
| 12/24 | ||
| 13/24 | ||
| 14/24 | ||
| 15/24 | ||
| 16/24 | ||
| 17/24 | ||
| 18/24 | ||
| 19/24 | ||
| 20/24 | ||
| 21/24 | ||
| 22/24 | ||
| 23/24 | R-b | |
| 24/24 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [kvm-unit-tests PATCH v4 00/24] x86/pmu: Test case optimization, fixes and additions
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/[email protected]/
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
Signature · 1 line
2.38.1