Skip to content

Fix PMU kselftests errors on SRF and CWF

Dapeng Mi kvm lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3KVM: Selftests: Validate more arch-events in pmu_counters_testtools/testing/selftests/kvm/include/x86/pmu.h tools/testing/selftests/kvm/include/x86/processor.h tools/testing/selftests/kvm/lib/x86/pmu.c +1 more+38 -60 replies
2/3KVM: selftests: Relax precise event count validation as overcount issuetools/testing/selftests/kvm/include/x86/pmu.h tools/testing/selftests/kvm/lib/x86/pmu.c tools/testing/selftests/kvm/x86/pmu_counters_test.c+62 -20 replies
3/3KVM: selftests: Relax branches event count check for event_filter testtools/testing/selftests/kvm/x86/pmu_event_filter_test.c+8 -10 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchYi Lai
1/3T-b
2/3T-b
3/3T-b

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

Read the v1 thread

Cover letter [PATCH 0/3] Fix PMU kselftests errors on SRF and CWF

This small patchset fixes PMU kselftest errors on Sierra Forest (SRF) and Clearwater Forest (CWF).

Patch 1/3 adds validation support for newly introduced 5 architectural events on CWF. Without this patch, pmu_counter_test asserts failure
"New architectural event(s) detected; please update this 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[1].

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 this overcount issue, pmu_counters_test and pmu_event_filter_test would fail on the precise event count validation for these 2 events on Atom platforms.

To work around this Atom platform overcount issue, Patches 2-3/3 relax the precise event count validation if the platform is detected to have the overcount issue.

Tests:
* PMU kselftests (pmu_counters_test/pmu_event_filter_test/ vmx_pmu_caps_test) passed on GNR/SRF/CWF platforms.

Ref:
[1] https://edc.intel.com/content/www/us/en/design/products-and-solutions/processors-and-chipsets/sierra-forest/xeon-6700-series-processor-with-e-cores-specification-update/errata-details

Dapeng Mi (2):
KVM: Selftests: Validate more arch-events in pmu_counters_test
KVM: selftests: Relax branches event count check for event_filter test

dongsheng (1):
KVM: selftests: Relax precise event count validation as overcount
issue

 tools/testing/selftests/kvm/include/x86/pmu.h | 19 ++++++++
 .../selftests/kvm/include/x86/processor.h     |  7 ++-
 tools/testing/selftests/kvm/lib/x86/pmu.c     | 43 +++++++++++++++++++
 .../selftests/kvm/x86/pmu_counters_test.c     | 39 ++++++++++++++---
 .../selftests/kvm/x86/pmu_event_filter_test.c |  9 +++-
 5 files changed, 108 insertions(+), 9 deletions(-)

base-commit: 772d50d9b87bec08b56ecee0a880d6b2ee5c7da5

Signature · 1 line
2.43.0