x86/pmu: Fix test errors on GNR/SRF/CWF
Status from this message: Applied to kvm-x86 next, thanks!
Get series with b4
b4 am [email protected]Versions newest first
Changes in v4 from the cover letter
- Track the errata in pmu_caps so that the information is available to all tests (even though non-PMU tests are unlikely to care).
- Keep the measure_for_overflow() call for fixed counters.
- Handle errata independently for precise checks.
Patches in v4 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | x86/pmu: Add helper to detect Intel overcount issueslib/ lib/ lib/ | +70 | 0 replies | |
| 2/8 | x86/pmu: Relax precise count validation for Intel overcounted platformsx86/ | +9 | 0 replies | |
| 3/8 | x86/pmu: Fix incorrect masking of fixed countersx86/ | +5 | 0 replies | |
| 4/8 | x86/pmu: Handle instruction overcount issue in overflow testx86/ | +21 | 0 replies | |
| 5/8 | x86/pmu: Relax precise count check for emulated instructions testsx86/ | +12 | 0 replies | |
| 6/8 | x86/pmu: Expand "llc references" upper limit for broader compatibilityx86/ | +1 | 0 replies | |
| 7/8 | x86: pmu_pebs: Remove abundant data_cfg_match calculationx86/ | +0 | 0 replies | |
| 8/8 | x86: pmu_pebs: Support to validate timed PEBS record on GNR/SRFlib/ x86/ | +11 | 0 replies |
Reviews trailers per patch
1 of 8 patches has a Reviewed-by or Acked-by.
| Patch | Yi Lai | Kan Liang |
|---|---|---|
| 1/8 | T-b | |
| 2/8 | T-b | |
| 3/8 | T-b | |
| 4/8 | T-b | |
| 5/8 | ||
| 6/8 | T-b | |
| 7/8 | T-b | |
| 8/8 | T-b | R-b |
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 0/8] x86/pmu: Fix test errors on GNR/SRF/CWF
Refreshed version of Dapeng's series to address minor flaws in v3.
This patchset fixes the pmu test errors on Granite Rapids (GNR), Sierra Forest (SRF) and Clearwater Forest (CWF).
GNR and SRF start to support the timed PEBS. Timed PEBS adds a new "retired latency" field in basic info group to show the timing info and the PERF_CAPABILITIES[17] called "PEBS_TIMING_INFO" bit is added to indicated whether timed PEBS is supported. KVM module doesn't need to do any specific change to support timed PEBS except a perf change adding PERF_CAP_PEBS_TIMING_INFO flag into PERF_CAP_PEBS_MASK[1]. The patch 7/7 supports timed PEBS validation in pmu_pebs test.
On Intel Atom platforms, the PMU events "Instruction Retired" or "Branch Instruction Retired" may be overcounted for some certain instructions, like FAR CALL/JMP, RETF, IRET, VMENTRY/VMEXIT/VMPTRLD and complex SGX/SMX/CSTATE instructions/flows[2].
In details, for the Atom platforms before Sierra Forest (including Sierra Forest), Both 2 events "Instruction Retired" and "Branch Instruction Retired" would be overcounted on these certain instructions, but for Clearwater Forest only "Instruction Retired" event is overcounted on these instructions.
As the overcount issue, pmu test would fail to validate the precise count for these 2 events on SRF and CWF. Patches 1-4/7 detects if the platform has this overcount issue, if so relax the precise count validation for these 2 events.
Besides it looks more LLC references are needed on SRF/CWF, so adjust the "LLC references" event count range.
Tests:
* pmu tests passed on SPR/GNR/SRF/CWF.
* pmu_lbr tests is skiped on SPR/GNR/SRF/CWF since mediated vPMU based arch-LBR support is not upstreamed yet.
* pmu_pebs test passed on SPR/GNR/SRF and skiped on CWF since CWF introduces architectural PEBS and mediated vPMU based arch-PEBS support is not upstreamed yet.
v4:
- Track the errata in pmu_caps so that the information is available to all tests (even though non-PMU tests are unlikely to care).
- Keep the measure_for_overflow() call for fixed counters.
- Handle errata independently for precise checks.
v3:
- https://lore.kernel.org/all/[email protected]
- Fix the emulated instruction validation error on SRF/CWF. (Patch 5/8)
v2:
- Fix the flaws on x86_model() helper (Xiaoyao).
- Fix the pmu_pebs error on GNR/SRF.
Dapeng Mi (3):
x86/pmu: Relax precise count check for emulated instructions tests
x86: pmu_pebs: Remove abundant data_cfg_match calculation
x86: pmu_pebs: Support to validate timed PEBS record on GNR/SRF
dongsheng (5):
x86/pmu: Add helper to detect Intel overcount issues x86/pmu: Relax precise count validation for Intel overcounted
platforms
x86/pmu: Fix incorrect masking of fixed counters
x86/pmu: Handle instruction overcount issue in overflow test x86/pmu: Expand "llc references" upper limit for broader compatibility
lib/x86/pmu.c | 39 ++++++++++++++++++++++++ lib/x86/pmu.h | 11 +++++++ lib/x86/processor.h | 26 ++++++++++++++++ x86/pmu.c | 72 ++++++++++++++++++++++++++++++--------------- x86/pmu_pebs.c | 9 +++--- 5 files changed, 129 insertions(+), 28 deletions(-)
base-commit: de952a4bf26cb2e93c634445034645523f65d28b
Signature · 1 line
2.52.0.rc2.455.g230fcf2819-goog