[PATCH v5 5/5] selftests/resctrl: Enable MBM and MBA tests on AMD

From: Swapnil Sapkal

Date: Thu Oct 22 2026 - 09:31:36 EST


From: Babu Moger <babu.moger@xxxxxxx>

Now that the UMC (Unified Memory Controller) perf events can be used to
validate the resctrl memory bandwidth numbers on AMD, extend the
vendor_specific gate of the MBM and MBA tests to also cover AMD so that
they run on AMD in addition to Intel.

The tests stay restricted to Intel and AMD: enumerate_mcs()
only knows about the iMC and UMC counters, so keeping the gate (rather
than making the tests universal) leaves other vendors skipped instead of
failing.

Assisted-by: Claude:claude-opus-4.8
Signed-off-by: Babu Moger <babu.moger@xxxxxxx>
Co-developed-by: Swapnil Sapkal <swapnil.sapkal@xxxxxxx>
Signed-off-by: Swapnil Sapkal <swapnil.sapkal@xxxxxxx>
---

v4->v5:
- Rebased onto kselftest/next; updated the changelog reference from
num_of_mem_controllers() to enumerate_mcs().

v3->v4:
- Rebased onto v7.2-rc7.
- Extend the vendor_specific gate to ARCH_INTEL | ARCH_AMD instead of
removing it, so unsupported vendors are skipped rather than reported
as a failure.

tools/testing/selftests/resctrl/mba_test.c | 2 +-
tools/testing/selftests/resctrl/mbm_test.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c
index 947735e26099..95250cfa5cd8 100644
--- a/tools/testing/selftests/resctrl/mba_test.c
+++ b/tools/testing/selftests/resctrl/mba_test.c
@@ -272,7 +272,7 @@ static bool mba_feature_check(const struct resctrl_test *test)
struct resctrl_test mba_test = {
.name = "MBA",
.resource = "MB",
- .vendor_specific = ARCH_INTEL,
+ .vendor_specific = ARCH_INTEL | ARCH_AMD,
.feature_check = mba_feature_check,
.run_test = mba_run_test,
.cleanup = mba_test_cleanup,
diff --git a/tools/testing/selftests/resctrl/mbm_test.c b/tools/testing/selftests/resctrl/mbm_test.c
index e24c6237a22f..b2c5fd0ab8e3 100644
--- a/tools/testing/selftests/resctrl/mbm_test.c
+++ b/tools/testing/selftests/resctrl/mbm_test.c
@@ -178,7 +178,7 @@ static bool mbm_feature_check(const struct resctrl_test *test)
struct resctrl_test mbm_test = {
.name = "MBM",
.resource = "MB",
- .vendor_specific = ARCH_INTEL,
+ .vendor_specific = ARCH_INTEL | ARCH_AMD,
.feature_check = mbm_feature_check,
.run_test = mbm_run_test,
.cleanup = mbm_test_cleanup,
--
2.43.0