* [PATCH 0/4] selftest/arm64: Fix MTE test setup and TAP reporting
@ 2026-08-20 15:33 Muhammad Usama Anjum
2026-08-20 15:33 ` [PATCH 1/4] selftest/arm64: Print TAP header Muhammad Usama Anjum
` (3 more replies)
0 siblings, 4 replies; 16+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-20 15:33 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Mark Brown, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
Cc: Muhammad Usama Anjum
Running the mainline arm64 MTE selftests on a Pixel 8 exposed three
independent reporting problems. Fix each issue independently, then
add an arm64 Kconfig fragment covering the facilities used by the MTE
tests.
Testing was performed on a Pixel 8 with an Android 6.1 kernel built with
the new configuration. All nine static MTE binaries returned success.
Muhammad Usama Anjum (4):
selftest/arm64: Print TAP header
selftest/arm64: Treat KSM merge_across_nodes as optional
selftest/arm64: Fix MTE prctl TAP plan
selftest/arm64: Add MTE test config fragment
.../selftests/arm64/mte/check_gcr_el1_cswitch.c | 1 +
.../testing/selftests/arm64/mte/check_ksm_options.c | 12 +++++++++---
tools/testing/selftests/arm64/mte/check_prctl.c | 2 +-
tools/testing/selftests/arm64/mte/config | 8 ++++++++
4 files changed, 19 insertions(+), 4 deletions(-)
create mode 100644 tools/testing/selftests/arm64/mte/config
--
2.47.3
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/4] selftest/arm64: Print TAP header
2026-08-20 15:33 [PATCH 0/4] selftest/arm64: Fix MTE test setup and TAP reporting Muhammad Usama Anjum
@ 2026-08-20 15:33 ` Muhammad Usama Anjum
2026-08-20 15:43 ` Mark Brown
2026-08-20 15:33 ` [PATCH 2/4] selftest/arm64: Treat KSM merge_across_nodes as optional Muhammad Usama Anjum
` (2 subsequent siblings)
3 siblings, 1 reply; 16+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-20 15:33 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Mark Brown, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
Cc: Muhammad Usama Anjum
The test sets a TAP plan and emits a result but does not print the TAP
version header. Direct execution therefore starts with:
1..1
instead of "TAP version 13", leaving the output malformed for TAP
consumers.
Print the kselftest header before the plan, matching the other arm64 MTE
tests.
Fixes: 29f080881601 ("kselftest/arm64: check GCR_EL1 after context switch")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c b/tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c
index 325bca0de0f6e..d23f154d3288c 100644
--- a/tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c
+++ b/tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c
@@ -131,6 +131,7 @@ int main(int argc, char *argv[])
if (err)
return err;
+ ksft_print_header();
ksft_set_plan(1);
evaluate_test(mte_gcr_fork_test(),
--
2.47.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 2/4] selftest/arm64: Treat KSM merge_across_nodes as optional
2026-08-20 15:33 [PATCH 0/4] selftest/arm64: Fix MTE test setup and TAP reporting Muhammad Usama Anjum
2026-08-20 15:33 ` [PATCH 1/4] selftest/arm64: Print TAP header Muhammad Usama Anjum
@ 2026-08-20 15:33 ` Muhammad Usama Anjum
2026-08-20 16:09 ` Mark Brown
2026-08-20 15:33 ` [PATCH 3/4] selftest/arm64: Fix MTE prctl TAP plan Muhammad Usama Anjum
2026-08-20 15:33 ` [PATCH 4/4] selftest/arm64: Add MTE test config fragment Muhammad Usama Anjum
3 siblings, 1 reply; 16+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-20 15:33 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Mark Brown, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
Cc: Muhammad Usama Anjum
The MTE KSM test unconditionally saves, enables and restores the
merge_across_nodes sysfs attribute. The kernel only creates this
attribute when CONFIG_NUMA=y. A non-NUMA kernel consequently prints the
following message three times even though all KSM subtests pass:
# ERR: missing /sys/kernel/mm/ksm/merge_across_nodes
Check whether the attribute exists and only access it when present. This
preserves the existing setup and restore behavior on NUMA kernels without
requiring NUMA or reducing KSM coverage on single-node systems.
Fixes: f981d8fa2646 ("kselftest/arm64: Verify KSM page merge for MTE pages")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
.../testing/selftests/arm64/mte/check_ksm_options.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/arm64/mte/check_ksm_options.c b/tools/testing/selftests/arm64/mte/check_ksm_options.c
index 0cf5faef17248..b36945fc883d3 100644
--- a/tools/testing/selftests/arm64/mte/check_ksm_options.c
+++ b/tools/testing/selftests/arm64/mte/check_ksm_options.c
@@ -6,6 +6,7 @@
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -22,6 +23,7 @@
static size_t page_sz;
static unsigned long ksm_sysfs[5];
+static bool has_merge_across_nodes;
static unsigned long read_sysfs(char *str)
{
@@ -56,8 +58,11 @@ static void write_sysfs(char *str, unsigned long val)
static void mte_ksm_setup(void)
{
- ksm_sysfs[0] = read_sysfs(PATH_KSM "merge_across_nodes");
- write_sysfs(PATH_KSM "merge_across_nodes", 1);
+ has_merge_across_nodes = !access(PATH_KSM "merge_across_nodes", F_OK);
+ if (has_merge_across_nodes) {
+ ksm_sysfs[0] = read_sysfs(PATH_KSM "merge_across_nodes");
+ write_sysfs(PATH_KSM "merge_across_nodes", 1);
+ }
ksm_sysfs[1] = read_sysfs(PATH_KSM "sleep_millisecs");
write_sysfs(PATH_KSM "sleep_millisecs", 0);
ksm_sysfs[2] = read_sysfs(PATH_KSM "run");
@@ -70,7 +75,8 @@ static void mte_ksm_setup(void)
static void mte_ksm_restore(void)
{
- write_sysfs(PATH_KSM "merge_across_nodes", ksm_sysfs[0]);
+ if (has_merge_across_nodes)
+ write_sysfs(PATH_KSM "merge_across_nodes", ksm_sysfs[0]);
write_sysfs(PATH_KSM "sleep_millisecs", ksm_sysfs[1]);
write_sysfs(PATH_KSM "run", ksm_sysfs[2]);
write_sysfs(PATH_KSM "max_page_sharing", ksm_sysfs[3]);
--
2.47.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 3/4] selftest/arm64: Fix MTE prctl TAP plan
2026-08-20 15:33 [PATCH 0/4] selftest/arm64: Fix MTE test setup and TAP reporting Muhammad Usama Anjum
2026-08-20 15:33 ` [PATCH 1/4] selftest/arm64: Print TAP header Muhammad Usama Anjum
2026-08-20 15:33 ` [PATCH 2/4] selftest/arm64: Treat KSM merge_across_nodes as optional Muhammad Usama Anjum
@ 2026-08-20 15:33 ` Muhammad Usama Anjum
2026-08-20 16:14 ` Mark Brown
2026-08-20 15:33 ` [PATCH 4/4] selftest/arm64: Add MTE test config fragment Muhammad Usama Anjum
3 siblings, 1 reply; 16+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-20 15:33 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Mark Brown, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
Cc: Muhammad Usama Anjum
The MTE prctl test emits one result from check_basic_read() followed by
one result for each of the seven entries in mte_modes[]. However, the TAP
plan only accounts for the array entries, producing:
# Planned tests != run tests (7 != 8)
Include the basic read check in the plan so that all eight emitted results
are declared.
Fixes: 1f488fb91378 ("kselftest/arm64/mte: Add MTE_STORE_ONLY testcases")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
tools/testing/selftests/arm64/mte/check_prctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/arm64/mte/check_prctl.c b/tools/testing/selftests/arm64/mte/check_prctl.c
index f7f320defa7b9..d16a91117eef9 100644
--- a/tools/testing/selftests/arm64/mte/check_prctl.c
+++ b/tools/testing/selftests/arm64/mte/check_prctl.c
@@ -119,7 +119,7 @@ int main(void)
int i;
ksft_print_header();
- ksft_set_plan(ARRAY_SIZE(mte_modes));
+ ksft_set_plan(ARRAY_SIZE(mte_modes) + 1);
check_basic_read();
for (i = 0; i < ARRAY_SIZE(mte_modes); i++)
--
2.47.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 4/4] selftest/arm64: Add MTE test config fragment
2026-08-20 15:33 [PATCH 0/4] selftest/arm64: Fix MTE test setup and TAP reporting Muhammad Usama Anjum
` (2 preceding siblings ...)
2026-08-20 15:33 ` [PATCH 3/4] selftest/arm64: Fix MTE prctl TAP plan Muhammad Usama Anjum
@ 2026-08-20 15:33 ` Muhammad Usama Anjum
2026-08-20 15:38 ` Mark Brown
2026-08-21 8:55 ` Catalin Marinas
3 siblings, 2 replies; 16+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-20 15:33 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Mark Brown, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
Cc: Muhammad Usama Anjum
The arm64 selftest collection has no Kconfig fragment, so kernels built
with the selftest requirements are not guaranteed to provide the support
used by the MTE tests.
Add a fragment covering the userspace MTE and tagged-address ABIs, KSM
and its sysfs interface, explicit HugeTLB mappings and their proc/sysctl
interfaces, and tmpfs-backed file mappings.
Do not request NUMA solely for the optional KSM merge_across_nodes.
Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
tools/testing/selftests/arm64/mte/config | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 tools/testing/selftests/arm64/mte/config
diff --git a/tools/testing/selftests/arm64/mte/config b/tools/testing/selftests/arm64/mte/config
new file mode 100644
index 0000000000000..8587ce70c294a
--- /dev/null
+++ b/tools/testing/selftests/arm64/mte/config
@@ -0,0 +1,8 @@
+CONFIG_ARM64_MTE=y
+CONFIG_ARM64_TAGGED_ADDR_ABI=y
+CONFIG_HUGETLBFS=y
+CONFIG_KSM=y
+CONFIG_PROC_FS=y
+CONFIG_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
--
2.47.3
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 4/4] selftest/arm64: Add MTE test config fragment
2026-08-20 15:33 ` [PATCH 4/4] selftest/arm64: Add MTE test config fragment Muhammad Usama Anjum
@ 2026-08-20 15:38 ` Mark Brown
2026-08-20 15:42 ` Muhammad Usama Anjum
2026-08-21 8:55 ` Catalin Marinas
1 sibling, 1 reply; 16+ messages in thread
From: Mark Brown @ 2026-08-20 15:38 UTC (permalink / raw)
To: Muhammad Usama Anjum
Cc: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
On Thu, Aug 20, 2026 at 04:33:26PM +0100, Muhammad Usama Anjum wrote:
> The arm64 selftest collection has no Kconfig fragment, so kernels built
> with the selftest requirements are not guaranteed to provide the support
> used by the MTE tests.
> tools/testing/selftests/arm64/mte/config | 8 ++++++++
Is tooling going to pick this up or should this be at the arm64/ level?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 4/4] selftest/arm64: Add MTE test config fragment
2026-08-20 15:38 ` Mark Brown
@ 2026-08-20 15:42 ` Muhammad Usama Anjum
2026-08-20 16:42 ` Mark Brown
0 siblings, 1 reply; 16+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-20 15:42 UTC (permalink / raw)
To: Mark Brown
Cc: usama.anjum, Catalin Marinas, Will Deacon, Mark Rutland,
Shuah Khan, Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
On 20/08/2026 4:38 pm, Mark Brown wrote:
> On Thu, Aug 20, 2026 at 04:33:26PM +0100, Muhammad Usama Anjum wrote:
>> The arm64 selftest collection has no Kconfig fragment, so kernels built
>> with the selftest requirements are not guaranteed to provide the support
>> used by the MTE tests.
>
>> tools/testing/selftests/arm64/mte/config | 8 ++++++++
>
> Is tooling going to pick this up or should this be at the arm64/ level?
Yes, it will be picked up. The top-level kselftest-merge target recursively
finds every file named config under tools/testing/selftests, so
arm64/mte/config is included.
--
Thanks,
Usama
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/4] selftest/arm64: Print TAP header
2026-08-20 15:33 ` [PATCH 1/4] selftest/arm64: Print TAP header Muhammad Usama Anjum
@ 2026-08-20 15:43 ` Mark Brown
0 siblings, 0 replies; 16+ messages in thread
From: Mark Brown @ 2026-08-20 15:43 UTC (permalink / raw)
To: Muhammad Usama Anjum
Cc: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
[-- Attachment #1: Type: text/plain, Size: 443 bytes --]
On Thu, Aug 20, 2026 at 04:33:23PM +0100, Muhammad Usama Anjum wrote:
> The test sets a TAP plan and emits a result but does not print the TAP
> version header. Direct execution therefore starts with:
>
> 1..1
>
> instead of "TAP version 13", leaving the output malformed for TAP
> consumers.
>
> Print the kselftest header before the plan, matching the other arm64 MTE
> tests.
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/4] selftest/arm64: Treat KSM merge_across_nodes as optional
2026-08-20 15:33 ` [PATCH 2/4] selftest/arm64: Treat KSM merge_across_nodes as optional Muhammad Usama Anjum
@ 2026-08-20 16:09 ` Mark Brown
2026-08-21 10:57 ` Muhammad Usama Anjum
0 siblings, 1 reply; 16+ messages in thread
From: Mark Brown @ 2026-08-20 16:09 UTC (permalink / raw)
To: Muhammad Usama Anjum
Cc: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]
On Thu, Aug 20, 2026 at 04:33:24PM +0100, Muhammad Usama Anjum wrote:
> The MTE KSM test unconditionally saves, enables and restores the
> merge_across_nodes sysfs attribute. The kernel only creates this
> attribute when CONFIG_NUMA=y. A non-NUMA kernel consequently prints the
> following message three times even though all KSM subtests pass:
> static void mte_ksm_setup(void)
> {
> - ksm_sysfs[0] = read_sysfs(PATH_KSM "merge_across_nodes");
> - write_sysfs(PATH_KSM "merge_across_nodes", 1);
> + has_merge_across_nodes = !access(PATH_KSM "merge_across_nodes", F_OK);
Don't we need the file to be readable and writable, not just extant?
Looking quickly at the test I'm actually not spotting where it checks
that it's running as root which I think it needs in general.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 3/4] selftest/arm64: Fix MTE prctl TAP plan
2026-08-20 15:33 ` [PATCH 3/4] selftest/arm64: Fix MTE prctl TAP plan Muhammad Usama Anjum
@ 2026-08-20 16:14 ` Mark Brown
0 siblings, 0 replies; 16+ messages in thread
From: Mark Brown @ 2026-08-20 16:14 UTC (permalink / raw)
To: Muhammad Usama Anjum
Cc: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
[-- Attachment #1: Type: text/plain, Size: 473 bytes --]
On Thu, Aug 20, 2026 at 04:33:25PM +0100, Muhammad Usama Anjum wrote:
> The MTE prctl test emits one result from check_basic_read() followed by
> one result for each of the seven entries in mte_modes[]. However, the TAP
> plan only accounts for the array entries, producing:
>
> # Planned tests != run tests (7 != 8)
>
> Include the basic read check in the plan so that all eight emitted results
> are declared.
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 4/4] selftest/arm64: Add MTE test config fragment
2026-08-20 15:42 ` Muhammad Usama Anjum
@ 2026-08-20 16:42 ` Mark Brown
2026-08-21 8:01 ` Muhammad Usama Anjum
0 siblings, 1 reply; 16+ messages in thread
From: Mark Brown @ 2026-08-20 16:42 UTC (permalink / raw)
To: Muhammad Usama Anjum
Cc: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
[-- Attachment #1: Type: text/plain, Size: 657 bytes --]
On Thu, Aug 20, 2026 at 04:42:16PM +0100, Muhammad Usama Anjum wrote:
> On 20/08/2026 4:38 pm, Mark Brown wrote:
> > Is tooling going to pick this up or should this be at the arm64/ level?
> Yes, it will be picked up. The top-level kselftest-merge target recursively
> finds every file named config under tools/testing/selftests, so
> arm64/mte/config is included.
That's good, though looking at the list we have requirements for
CONFIG_SYSFS in other tests, probably some of the other stuff as well so
we should either do something at the top level or decide we're going to
do this independently for all the subdirectories. Top level seems
easier TBH.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 4/4] selftest/arm64: Add MTE test config fragment
2026-08-20 16:42 ` Mark Brown
@ 2026-08-21 8:01 ` Muhammad Usama Anjum
0 siblings, 0 replies; 16+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-21 8:01 UTC (permalink / raw)
To: Mark Brown
Cc: usama.anjum, Catalin Marinas, Will Deacon, Mark Rutland,
Shuah Khan, Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
On 20/08/2026 5:42 pm, Mark Brown wrote:
> On Thu, Aug 20, 2026 at 04:42:16PM +0100, Muhammad Usama Anjum wrote:
>> On 20/08/2026 4:38 pm, Mark Brown wrote:
>
>>> Is tooling going to pick this up or should this be at the arm64/ level?
>
>> Yes, it will be picked up. The top-level kselftest-merge target recursively
>> finds every file named config under tools/testing/selftests, so
>> arm64/mte/config is included.
>
> That's good, though looking at the list we have requirements for
> CONFIG_SYSFS in other tests, probably some of the other stuff as well so
> we should either do something at the top level or decide we're going to
> do this independently for all the subdirectories. Top level seems
> easier TBH.
I wanted to keep limited scope of this series. Hence was just looking
from mte's perspective which is narrow. You are right on putting one
config file for all of arm64. I'll run/look through all of arm64 to
see which more configs are needed and move the config file in top level.
--
Thanks,
Usama
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 4/4] selftest/arm64: Add MTE test config fragment
2026-08-20 15:33 ` [PATCH 4/4] selftest/arm64: Add MTE test config fragment Muhammad Usama Anjum
2026-08-20 15:38 ` Mark Brown
@ 2026-08-21 8:55 ` Catalin Marinas
2026-08-21 10:43 ` Muhammad Usama Anjum
2026-08-21 11:38 ` Mark Brown
1 sibling, 2 replies; 16+ messages in thread
From: Catalin Marinas @ 2026-08-21 8:55 UTC (permalink / raw)
To: Muhammad Usama Anjum
Cc: Will Deacon, Mark Rutland, Shuah Khan, Andrey Konovalov,
Andrew Morton, Vincenzo Frascino, Amit Daniel Kachhap, Mark Brown,
Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
On Thu, Aug 20, 2026 at 04:33:26PM +0100, Muhammad Usama Anjum wrote:
> The arm64 selftest collection has no Kconfig fragment, so kernels built
> with the selftest requirements are not guaranteed to provide the support
> used by the MTE tests.
>
> Add a fragment covering the userspace MTE and tagged-address ABIs, KSM
> and its sysfs interface, explicit HugeTLB mappings and their proc/sysctl
> interfaces, and tmpfs-backed file mappings.
>
> Do not request NUMA solely for the optional KSM merge_across_nodes.
>
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
> ---
> tools/testing/selftests/arm64/mte/config | 8 ++++++++
> 1 file changed, 8 insertions(+)
> create mode 100644 tools/testing/selftests/arm64/mte/config
>
> diff --git a/tools/testing/selftests/arm64/mte/config b/tools/testing/selftests/arm64/mte/config
> new file mode 100644
> index 0000000000000..8587ce70c294a
> --- /dev/null
> +++ b/tools/testing/selftests/arm64/mte/config
> @@ -0,0 +1,8 @@
> +CONFIG_ARM64_MTE=y
> +CONFIG_ARM64_TAGGED_ADDR_ABI=y
> +CONFIG_HUGETLBFS=y
> +CONFIG_KSM=y
> +CONFIG_PROC_FS=y
> +CONFIG_SYSCTL=y
You may want CONFIG_PROC_SYSCTL.
> +CONFIG_SYSFS=y
> +CONFIG_TMPFS=y
These are all covered by defconfig. Are these fragments still necessary?
Or are they supposed to work on custom configs? If the latter EXPERT may
be set, hence the PROC_SYSCTL above. You probably also need SHMEM.
--
Catalin
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 4/4] selftest/arm64: Add MTE test config fragment
2026-08-21 8:55 ` Catalin Marinas
@ 2026-08-21 10:43 ` Muhammad Usama Anjum
2026-08-21 11:38 ` Mark Brown
1 sibling, 0 replies; 16+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-21 10:43 UTC (permalink / raw)
To: Catalin Marinas
Cc: usama.anjum, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Mark Brown, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
On 21/08/2026 9:55 am, Catalin Marinas wrote:
> On Thu, Aug 20, 2026 at 04:33:26PM +0100, Muhammad Usama Anjum wrote:
>> The arm64 selftest collection has no Kconfig fragment, so kernels built
>> with the selftest requirements are not guaranteed to provide the support
>> used by the MTE tests.
>>
>> Add a fragment covering the userspace MTE and tagged-address ABIs, KSM
>> and its sysfs interface, explicit HugeTLB mappings and their proc/sysctl
>> interfaces, and tmpfs-backed file mappings.
>>
>> Do not request NUMA solely for the optional KSM merge_across_nodes.
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
>> ---
>> tools/testing/selftests/arm64/mte/config | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>> create mode 100644 tools/testing/selftests/arm64/mte/config
>>
>> diff --git a/tools/testing/selftests/arm64/mte/config b/tools/testing/selftests/arm64/mte/config
>> new file mode 100644
>> index 0000000000000..8587ce70c294a
>> --- /dev/null
>> +++ b/tools/testing/selftests/arm64/mte/config
>> @@ -0,0 +1,8 @@
>> +CONFIG_ARM64_MTE=y
>> +CONFIG_ARM64_TAGGED_ADDR_ABI=y
>> +CONFIG_HUGETLBFS=y
>> +CONFIG_KSM=y
>> +CONFIG_PROC_FS=y
>> +CONFIG_SYSCTL=y
>
> You may want CONFIG_PROC_SYSCTL.
CONFIG_PROC_SYSCTL no longer exists on the linux-next base used for this
series. It was removed by commit 8d75c338f0bce ("sysctl: remove
CONFIG_PROC_SYSCTL, it just mirrors CONFIG_SYSCTL"), so CONFIG_SYSCTL is
the corresponding requirement in this tree.
>
>> +CONFIG_SYSFS=y
>> +CONFIG_TMPFS=y
>
> These are all covered by defconfig. Are these fragments still necessary?
> Or are they supposed to work on custom configs? If the latter EXPERT may
> be set, hence the PROC_SYSCTL above. You probably also need SHMEM.
The entries were added based on the interfaces exercised by the tests,
rather than only on gaps in arm64 defconfig. The intention was for the
fragment to supply the MTE test requirements when kselftest-merge is used
with a custom configuration.
CONFIG_EXPERT selects DEBUG_KERNEL and exposes many unrelated configuration
options, so the fragment should enable only the concrete options required by
the tests.
--
Thanks,
Usama
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/4] selftest/arm64: Treat KSM merge_across_nodes as optional
2026-08-20 16:09 ` Mark Brown
@ 2026-08-21 10:57 ` Muhammad Usama Anjum
0 siblings, 0 replies; 16+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-21 10:57 UTC (permalink / raw)
To: Mark Brown
Cc: usama.anjum, Catalin Marinas, Will Deacon, Mark Rutland,
Shuah Khan, Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
On 20/08/2026 5:09 pm, Mark Brown wrote:
> On Thu, Aug 20, 2026 at 04:33:24PM +0100, Muhammad Usama Anjum wrote:
>> The MTE KSM test unconditionally saves, enables and restores the
>> merge_across_nodes sysfs attribute. The kernel only creates this
>> attribute when CONFIG_NUMA=y. A non-NUMA kernel consequently prints the
>> following message three times even though all KSM subtests pass:
>
>> static void mte_ksm_setup(void)
>> {
>> - ksm_sysfs[0] = read_sysfs(PATH_KSM "merge_across_nodes");
>> - write_sysfs(PATH_KSM "merge_across_nodes", 1);
>> + has_merge_across_nodes = !access(PATH_KSM "merge_across_nodes", F_OK);
>
> Don't we need the file to be readable and writable, not just extant?
Correct, I'll fix it.
> Looking quickly at the test I'm actually not spotting where it checks
> that it's running as root which I think it needs in general.
I'll add check for that as well.
--
Thanks,
Usama
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 4/4] selftest/arm64: Add MTE test config fragment
2026-08-21 8:55 ` Catalin Marinas
2026-08-21 10:43 ` Muhammad Usama Anjum
@ 2026-08-21 11:38 ` Mark Brown
1 sibling, 0 replies; 16+ messages in thread
From: Mark Brown @ 2026-08-21 11:38 UTC (permalink / raw)
To: Catalin Marinas
Cc: Muhammad Usama Anjum, Will Deacon, Mark Rutland, Shuah Khan,
Andrey Konovalov, Andrew Morton, Vincenzo Frascino,
Amit Daniel Kachhap, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
[-- Attachment #1: Type: text/plain, Size: 636 bytes --]
On Fri, Aug 21, 2026 at 09:55:44AM +0100, Catalin Marinas wrote:
> On Thu, Aug 20, 2026 at 04:33:26PM +0100, Muhammad Usama Anjum wrote:
> > +CONFIG_SYSFS=y
> > +CONFIG_TMPFS=y
> These are all covered by defconfig. Are these fragments still necessary?
> Or are they supposed to work on custom configs? If the latter EXPERT may
> be set, hence the PROC_SYSCTL above. You probably also need SHMEM.
In theory, yes since people might not run defconfig and it's supposed to
show what's needed for the tests. In practice people don't usually
bother, especially not for things like those which are going to be on in
any reasonable config.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-08-21 11:38 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 15:33 [PATCH 0/4] selftest/arm64: Fix MTE test setup and TAP reporting Muhammad Usama Anjum
2026-08-20 15:33 ` [PATCH 1/4] selftest/arm64: Print TAP header Muhammad Usama Anjum
2026-08-20 15:43 ` Mark Brown
2026-08-20 15:33 ` [PATCH 2/4] selftest/arm64: Treat KSM merge_across_nodes as optional Muhammad Usama Anjum
2026-08-20 16:09 ` Mark Brown
2026-08-21 10:57 ` Muhammad Usama Anjum
2026-08-20 15:33 ` [PATCH 3/4] selftest/arm64: Fix MTE prctl TAP plan Muhammad Usama Anjum
2026-08-20 16:14 ` Mark Brown
2026-08-20 15:33 ` [PATCH 4/4] selftest/arm64: Add MTE test config fragment Muhammad Usama Anjum
2026-08-20 15:38 ` Mark Brown
2026-08-20 15:42 ` Muhammad Usama Anjum
2026-08-20 16:42 ` Mark Brown
2026-08-21 8:01 ` Muhammad Usama Anjum
2026-08-21 8:55 ` Catalin Marinas
2026-08-21 10:43 ` Muhammad Usama Anjum
2026-08-21 11:38 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).