From: Shaopeng Tan <tan.shaopeng@fujitsu.com>
To: fenghuay@nvidia.com, reinette.chatre@intel.com,
ben.horgan@arm.com, james.morse@arm.com, shuah@kernel.org
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, tan.shaopeng@fujitsu.com
Subject: [RFC PATCH 1/5] kselftests/resctrl: Detect the ARM architecture
Date: Fri, 23 Jan 2026 13:40:27 +0900 [thread overview]
Message-ID: <20260123044034.141247-2-tan.shaopeng@fujitsu.com> (raw)
In-Reply-To: <20260123044034.141247-1-tan.shaopeng@fujitsu.com>
The resctrl test is not enabled for MPAM (ARM Memory System Resource
Partitioning and Monitoring)
Add processing to detect the ARM architecture.
Signed-off-by: Shaopeng Tan <tan.shaopeng@fujitsu.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 3c51bdac2dfa..492d2a1c4033 100644
--- a/tools/testing/selftests/resctrl/resctrl.h
+++ b/tools/testing/selftests/resctrl/resctrl.h
@@ -38,6 +38,7 @@
*/
#define ARCH_INTEL 1
#define ARCH_AMD 2
+#define ARCH_ARM 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 5154ffd821c4..662968d38eca 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -8,6 +8,7 @@
* Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>,
* Fenghua Yu <fenghua.yu@intel.com>
*/
+#include <sys/utsname.h>
#include "resctrl.h"
/* Volatile memory sink to prevent compiler optimizations */
@@ -26,6 +27,7 @@ static struct resctrl_test *resctrl_tests[] = {
static int detect_vendor(void)
{
FILE *inf = fopen("/proc/cpuinfo", "r");
+ struct utsname system_info;
int vendor_id = 0;
char *s = NULL;
char *res;
@@ -42,6 +44,11 @@ static int detect_vendor(void)
vendor_id = ARCH_INTEL;
else if (s && !strcmp(s, ": AuthenticAMD\n"))
vendor_id = ARCH_AMD;
+ else {
+ uname(&system_info);
+ if (strstr(system_info.machine, "aarch64") != NULL)
+ vendor_id = ARCH_ARM;
+ }
fclose(inf);
free(res);
--
2.47.3
next prev parent reply other threads:[~2026-01-23 4:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 4:40 [RFC PATCH 0/5] kselftest/resctrl: Enable CAT and NONCONT_CAT tests on ARM Shaopeng Tan
2026-01-23 4:40 ` Shaopeng Tan [this message]
2026-02-17 17:49 ` [RFC PATCH 1/5] kselftests/resctrl: Detect the ARM architecture Reinette Chatre
2026-01-23 4:40 ` [RFC PATCH 2/5] kselftests/resctrl: enable noncont_cat for MPAM Shaopeng Tan
2026-02-17 17:52 ` Reinette Chatre
2026-01-23 4:40 ` [RFC PATCH 3/5] kselftests/resctrl: remove unnecessary exclude_idle Shaopeng Tan
2026-02-17 17:52 ` Reinette Chatre
2026-03-02 7:35 ` Shaopeng Tan (Fujitsu)
2026-01-23 4:40 ` [RFC PATCH 4/5] kselftests/resctrl: set shareable_mask to zero if all bits are shared between software and hardware Shaopeng Tan
2026-02-17 17:52 ` Reinette Chatre
2026-01-23 4:40 ` [RFC PATCH 5/5] kselftests/resctrl: Add support for CAT test on ARM Shaopeng Tan
2026-01-27 20:47 ` Ben Horgan
2026-01-27 20:40 ` [RFC PATCH 0/5] kselftest/resctrl: Enable CAT and NONCONT_CAT tests " Ben Horgan
2026-03-02 7:26 ` Shaopeng Tan (Fujitsu)
2026-03-03 17:10 ` Ben Horgan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260123044034.141247-2-tan.shaopeng@fujitsu.com \
--to=tan.shaopeng@fujitsu.com \
--cc=ben.horgan@arm.com \
--cc=fenghuay@nvidia.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=reinette.chatre@intel.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®