[RFC patch 6/9] selftests/resctrl: Add support for HiSilicon CPU detection

Yifan Wu wuyifan50 at huawei.com
Tue Mar 3 20:03:31 PST 2026


Currently, the resctrl selftest suite only support x86 CPU vendors
(Intel, AMD and Hygon).

This commit adds support for HiSilicon CPUs detection, extending the
test coverage, and paving the way for vendor-specific implementation
adaptations on HiSilicon platform.

Signed-off-by: Yifan Wu <wuyifan50 at huawei.com>
---
 tools/testing/selftests/resctrl/resctrl.h       | 1 +
 tools/testing/selftests/resctrl/resctrl_tests.c | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
index 75c595812e7d..0e91d9704023 100644
--- a/tools/testing/selftests/resctrl/resctrl.h
+++ b/tools/testing/selftests/resctrl/resctrl.h
@@ -41,6 +41,7 @@
 #define ARCH_INTEL	BIT(0)
 #define ARCH_AMD	BIT(1)
 #define ARCH_HYGON	BIT(2)
+#define ARCH_HISILICON BIT(3)
 
 #define END_OF_TESTS	1
 
diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index 419d876a97c2..3299ae01346f 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -49,6 +49,13 @@ static DETECTION_ENTRY vendor_detection[] = {
 					{ .vendor_id = ARCH_AMD,	.arg = "AuthenticAMD" },
 					{ .vendor_id = ARCH_HYGON,	.arg = "HygonGenuine" },
 					{ .vendor_id = 0,	.arg = NULL }
+				},
+			},
+			{
+				.format = "CPU implementer\t: 0x%02x\n",
+				.vendor = (VENDOR_ENTRY[]) {
+					{ .vendor_id = ARCH_HISILICON,	.arg = 0x48 },
+					{ .vendor_id = 0,	.arg = NULL }
 				}
 			}
 		}
-- 
2.33.0




More information about the linux-arm-kernel mailing list