The resctrl MBA selftest is currently Intel-only: the test is
vendor-gated to GenuineIntel and its reference bandwidth measurement
is hard-wired to the Intel iMC uncore PMU. MPAM on arm64 exposes the
same MB resource through resctrl, and NVIDIA Grace/Vera systems
provide an uncore PMU (the SoC coherency fabric, SCF) that can serve
as the same kind of independent reference that the iMC provides on
x86.

Patches 1-2 decouple the test machinery from the iMC with no
functional change and no NVIDIA code: a mechanical rename, then a
small backend abstraction (detect()/setup_counters()) with the iMC as
the only backend. Patch 3 teaches the framework the MPAM memory
bandwidth monitoring layout (NUMA-node-keyed MB domains, MB_MON's
mbm_total_bytes, ABMC counter assignment). Patch 4 switches the MBA
test from vendor gating to feature detection. Patch 5 adds the NVIDIA
SCF PMU as a reference bandwidth backend, making the MBA test
runnable on arm64.

The series builds after each patch, and mid-series behavior is sane:
on arm64 the MBA test skips cleanly until patch 5, after which it
runs and passes. x86 behavior is preserved throughout - the iMC stays
the default backend and the mbm_local_bytes comparison path is
unchanged.

This series applies on top of the
26.04_linux-nvidia.glue.others.cpu_less.hardlimit branch of

  https://github.com/fyu1/NV-Kernels.fenghuay.baseos

The base-commit recorded below is the current tip of that branch.

Validated on a two-socket VR-NVL72 (Vera) system: the SCF-measured
bandwidth and resctrl mbm_total_bytes agree within 3-4% across all
MBA schemata levels (10%..100%), against the test's 8% threshold.

Richard Cheng (5):
  selftests/resctrl: Make memory bandwidth measurement vendor-neutral
  selftests/resctrl: Abstract reference bandwidth counters behind a
    backend
  selftests/resctrl: Support the MPAM memory bandwidth monitoring layout
  selftests/resctrl: Gate the MBA test on features, not CPU vendor
  selftests/resctrl: Add NVIDIA SCF reference bandwidth backend

 tools/testing/selftests/resctrl/mba_test.c    |  38 +-
 tools/testing/selftests/resctrl/mbm_test.c    |  23 +-
 tools/testing/selftests/resctrl/resctrl.h     |   6 +-
 tools/testing/selftests/resctrl/resctrl_val.c | 530 ++++++++++++++----
 tools/testing/selftests/resctrl/resctrlfs.c   |  45 +-
 5 files changed, 519 insertions(+), 123 deletions(-)


base-commit: 475f355d0408698d9f632ba3b9a5dfb1f91e928b
-- 
2.43.0


Reply via email to