* [PATCH v3 0/4] selftests/arm64: Fix MTE test setup and TAP reporting
@ 2026-08-25 11:18 Muhammad Usama Anjum
2026-08-25 11:18 ` [PATCH v3 1/4] selftests/arm64: Print missing MTE TAP headers Muhammad Usama Anjum
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-25 11:18 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Vincenzo Frascino, Andrey Konovalov, Andrew Morton,
Amit Daniel Kachhap, Yeoreum Yun, Mark Brown, 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 these reporting problems, 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.
Changes since v2:
- Combine the MTE TAP header fixes into a single patch.
- Treat inaccessible KSM merge_across_nodes as a skipped prerequisite.
Changes since v1:
- Add missing MTE TAP headers as an output-only cleanup and clarify why
line buffering prevents duplicate GCR_EL1 plan output.
- Validate KSM privileges and optional sysfs access before setup.
- Move and expand the arm64 config fragment, and standardize subjects on
the selftests/arm64 prefix.
Muhammad Usama Anjum (4):
selftests/arm64: Print missing MTE TAP headers
selftests/arm64: Treat KSM merge_across_nodes as optional
selftests/arm64: Fix MTE prctl TAP plan
selftests/arm64: Add MTE test config fragment
tools/testing/selftests/arm64/config | 17 ++++++++++
.../selftests/arm64/mte/check_buffer_fill.c | 2 ++
.../selftests/arm64/mte/check_child_memory.c | 2 ++
.../arm64/mte/check_gcr_el1_cswitch.c | 1 +
.../arm64/mte/check_hugetlb_options.c | 2 ++
.../selftests/arm64/mte/check_ksm_options.c | 31 +++++++++++++++++--
.../selftests/arm64/mte/check_mmap_options.c | 2 ++
.../testing/selftests/arm64/mte/check_prctl.c | 2 +-
.../arm64/mte/check_tags_inclusion.c | 2 ++
.../selftests/arm64/mte/check_user_mem.c | 2 ++
10 files changed, 59 insertions(+), 4 deletions(-)
create mode 100644 tools/testing/selftests/arm64/config
--
2.47.3
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 1/4] selftests/arm64: Print missing MTE TAP headers
2026-08-25 11:18 [PATCH v3 0/4] selftests/arm64: Fix MTE test setup and TAP reporting Muhammad Usama Anjum
@ 2026-08-25 11:18 ` Muhammad Usama Anjum
2026-08-25 13:58 ` Mark Brown
2026-08-26 8:25 ` Vincenzo Frascino
2026-08-25 11:18 ` [PATCH v3 2/4] selftests/arm64: Treat KSM merge_across_nodes as optional Muhammad Usama Anjum
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-25 11:18 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Vincenzo Frascino, Andrey Konovalov, Andrew Morton,
Amit Daniel Kachhap, Yeoreum Yun, Mark Brown, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
Cc: Muhammad Usama Anjum
Most MTE tests set a TAP plan and emit results without first printing
the TAP version header. Direct execution therefore starts with a plan
such as "1..20" instead of "TAP version 13".
The problem is particularly visible in the GCR_EL1 context-switch test.
It prints its plan before forking 1,024 child processes. When stdout is
fully buffered, the plan remains in the stdio buffer. Each child inherits
the pending "1..1" line and flushes its copy from exit(), producing
repeated plan lines.
ksft_print_header() prints the TAP header and enables line buffering.
Call it in every MTE test that is missing it. In the GCR_EL1 test, call
it before the plan so the plan is flushed before the children are
forked. In the remaining tests, call it before setup and prerequisite
checks so early failures and whole-test skips also retain the header.
Fixes: 29f080881601 ("kselftest/arm64: check GCR_EL1 after context switch")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
Changes since v2:
- Fold the remaining MTE TAP header additions into this patch.
- Retain the Fixes tag only for check_gcr_el1_cswitch.c, where missing
ksft_print_header() causes duplicate "1..1" plan lines.
- Drop the Reviewed-by tag because the combined patch was not reviewed.
Changes since v1:
- Explain how line buffering prevents duplicate plan lines.
- Use the selftests/arm64 subject prefix.
---
tools/testing/selftests/arm64/mte/check_buffer_fill.c | 2 ++
tools/testing/selftests/arm64/mte/check_child_memory.c | 2 ++
tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c | 1 +
tools/testing/selftests/arm64/mte/check_hugetlb_options.c | 2 ++
tools/testing/selftests/arm64/mte/check_ksm_options.c | 2 ++
tools/testing/selftests/arm64/mte/check_mmap_options.c | 2 ++
tools/testing/selftests/arm64/mte/check_tags_inclusion.c | 2 ++
tools/testing/selftests/arm64/mte/check_user_mem.c | 2 ++
8 files changed, 15 insertions(+)
diff --git a/tools/testing/selftests/arm64/mte/check_buffer_fill.c b/tools/testing/selftests/arm64/mte/check_buffer_fill.c
index ff4e075033493..039b1d7d85663 100644
--- a/tools/testing/selftests/arm64/mte/check_buffer_fill.c
+++ b/tools/testing/selftests/arm64/mte/check_buffer_fill.c
@@ -406,6 +406,8 @@ int main(int argc, char *argv[])
size_t page_size = getpagesize();
int item = ARRAY_SIZE(sizes);
+ ksft_print_header();
+
sizes[item - 3] = page_size - 1;
sizes[item - 2] = page_size;
sizes[item - 1] = page_size + 1;
diff --git a/tools/testing/selftests/arm64/mte/check_child_memory.c b/tools/testing/selftests/arm64/mte/check_child_memory.c
index 5e97ee792e4d2..e6a8acca2a941 100644
--- a/tools/testing/selftests/arm64/mte/check_child_memory.c
+++ b/tools/testing/selftests/arm64/mte/check_child_memory.c
@@ -146,6 +146,8 @@ int main(int argc, char *argv[])
int err;
int item = ARRAY_SIZE(sizes);
+ ksft_print_header();
+
page_size = getpagesize();
if (!page_size) {
ksft_print_msg("ERR: Unable to get page size\n");
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(),
diff --git a/tools/testing/selftests/arm64/mte/check_hugetlb_options.c b/tools/testing/selftests/arm64/mte/check_hugetlb_options.c
index aad1234c7e0fe..23e4a7a9950c1 100644
--- a/tools/testing/selftests/arm64/mte/check_hugetlb_options.c
+++ b/tools/testing/selftests/arm64/mte/check_hugetlb_options.c
@@ -230,6 +230,8 @@ int main(int argc, char *argv[])
void *map_ptr;
unsigned long map_size;
+ ksft_print_header();
+
err = mte_default_setup();
if (err)
return err;
diff --git a/tools/testing/selftests/arm64/mte/check_ksm_options.c b/tools/testing/selftests/arm64/mte/check_ksm_options.c
index 0cf5faef17248..866f0929b6647 100644
--- a/tools/testing/selftests/arm64/mte/check_ksm_options.c
+++ b/tools/testing/selftests/arm64/mte/check_ksm_options.c
@@ -132,6 +132,8 @@ int main(int argc, char *argv[])
{
int err;
+ ksft_print_header();
+
err = mte_default_setup();
if (err)
return err;
diff --git a/tools/testing/selftests/arm64/mte/check_mmap_options.c b/tools/testing/selftests/arm64/mte/check_mmap_options.c
index c100af3012cbb..492f2cd41f43b 100644
--- a/tools/testing/selftests/arm64/mte/check_mmap_options.c
+++ b/tools/testing/selftests/arm64/mte/check_mmap_options.c
@@ -945,6 +945,8 @@ int main(int argc, char *argv[])
},
};
+ ksft_print_header();
+
err = mte_default_setup();
if (err)
return err;
diff --git a/tools/testing/selftests/arm64/mte/check_tags_inclusion.c b/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
index 4b764f2a81857..6b4fa6705d7c1 100644
--- a/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
+++ b/tools/testing/selftests/arm64/mte/check_tags_inclusion.c
@@ -175,6 +175,8 @@ int main(int argc, char *argv[])
{
int err;
+ ksft_print_header();
+
err = mte_default_setup();
if (err)
return err;
diff --git a/tools/testing/selftests/arm64/mte/check_user_mem.c b/tools/testing/selftests/arm64/mte/check_user_mem.c
index fb7936c4e0978..af343aa617323 100644
--- a/tools/testing/selftests/arm64/mte/check_user_mem.c
+++ b/tools/testing/selftests/arm64/mte/check_user_mem.c
@@ -201,6 +201,8 @@ int main(int argc, char *argv[])
int tag_offsets[] = {page_sz, MT_GRANULE_SIZE};
char test_name[TEST_NAME_MAX];
+ ksft_print_header();
+
page_sz = getpagesize();
if (!page_sz) {
ksft_print_msg("ERR: Unable to get page size\n");
--
2.47.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 2/4] selftests/arm64: Treat KSM merge_across_nodes as optional
2026-08-25 11:18 [PATCH v3 0/4] selftests/arm64: Fix MTE test setup and TAP reporting Muhammad Usama Anjum
2026-08-25 11:18 ` [PATCH v3 1/4] selftests/arm64: Print missing MTE TAP headers Muhammad Usama Anjum
@ 2026-08-25 11:18 ` Muhammad Usama Anjum
2026-08-25 14:00 ` Mark Brown
2026-08-26 8:26 ` Vincenzo Frascino
2026-08-25 11:18 ` [PATCH v3 3/4] selftests/arm64: Fix MTE prctl TAP plan Muhammad Usama Anjum
2026-08-25 11:18 ` [PATCH v3 4/4] selftests/arm64: Add MTE test config fragment Muhammad Usama Anjum
3 siblings, 2 replies; 11+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-25 11:18 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Vincenzo Frascino, Andrey Konovalov, Andrew Morton,
Amit Daniel Kachhap, Yeoreum Yun, Mark Brown, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
Cc: Muhammad Usama Anjum
The MTE KSM test requires write access to KSM sysfs but does not check
that it is running as root. It also unconditionally saves, enables and
restores the merge_across_nodes attribute. The kernel only creates this
attribute when CONFIG_NUMA=y, so a non-NUMA kernel prints the following
message three times even though every KSM subtest passes:
# ERR: missing /sys/kernel/mm/ksm/merge_across_nodes
Skip the test when it is not running as root. Check that the optional
attribute is readable and writable, treating ENOENT as its expected
absence on non-NUMA kernels and skipping the test for other access
failures. Only save, enable and restore the attribute when it is
available.
Check MTE availability before the privilege and sysfs checks so systems
without MTE retain the existing feature-unavailable skip result.
This preserves the existing 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>
---
Changes since v2:
- Skip on merge_across_nodes access errors other than ENOENT.
Changes since v1:
- Check MTE availability before requiring root and validating
merge_across_nodes access.
- Use the selftests/arm64 subject prefix.
---
.../selftests/arm64/mte/check_ksm_options.c | 29 +++++++++++++++++--
1 file changed, 26 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 866f0929b6647..4855b737d5507 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,20 @@
static size_t page_sz;
static unsigned long ksm_sysfs[5];
+static bool has_merge_across_nodes;
+
+static bool merge_across_nodes_available(void)
+{
+ const char *path = PATH_KSM "merge_across_nodes";
+
+ if (!access(path, R_OK | W_OK))
+ return true;
+ if (errno == ENOENT)
+ return false;
+
+ ksft_exit_skip("Unable to read and write %s: %s\n", path,
+ strerror(errno));
+}
static unsigned long read_sysfs(char *str)
{
@@ -56,8 +71,10 @@ 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);
+ 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 +87,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]);
@@ -137,6 +155,11 @@ int main(int argc, char *argv[])
err = mte_default_setup();
if (err)
return err;
+
+ if (geteuid() != 0)
+ ksft_exit_skip("Please run the test as root\n");
+
+ has_merge_across_nodes = merge_across_nodes_available();
page_sz = getpagesize();
if (!page_sz) {
ksft_print_msg("ERR: Unable to get page size\n");
--
2.47.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 3/4] selftests/arm64: Fix MTE prctl TAP plan
2026-08-25 11:18 [PATCH v3 0/4] selftests/arm64: Fix MTE test setup and TAP reporting Muhammad Usama Anjum
2026-08-25 11:18 ` [PATCH v3 1/4] selftests/arm64: Print missing MTE TAP headers Muhammad Usama Anjum
2026-08-25 11:18 ` [PATCH v3 2/4] selftests/arm64: Treat KSM merge_across_nodes as optional Muhammad Usama Anjum
@ 2026-08-25 11:18 ` Muhammad Usama Anjum
2026-08-26 8:27 ` Vincenzo Frascino
2026-08-25 11:18 ` [PATCH v3 4/4] selftests/arm64: Add MTE test config fragment Muhammad Usama Anjum
3 siblings, 1 reply; 11+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-25 11:18 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Vincenzo Frascino, Andrey Konovalov, Andrew Morton,
Amit Daniel Kachhap, Yeoreum Yun, Mark Brown, 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.
Reviewed-by: Mark Brown <broonie@kernel.org>
Fixes: 1f488fb91378 ("kselftest/arm64/mte: Add MTE_STORE_ONLY testcases")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
Changes since v1:
- Use the selftests/arm64 subject prefix.
---
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] 11+ messages in thread
* [PATCH v3 4/4] selftests/arm64: Add MTE test config fragment
2026-08-25 11:18 [PATCH v3 0/4] selftests/arm64: Fix MTE test setup and TAP reporting Muhammad Usama Anjum
` (2 preceding siblings ...)
2026-08-25 11:18 ` [PATCH v3 3/4] selftests/arm64: Fix MTE prctl TAP plan Muhammad Usama Anjum
@ 2026-08-25 11:18 ` Muhammad Usama Anjum
2026-08-26 8:27 ` Vincenzo Frascino
3 siblings, 1 reply; 11+ messages in thread
From: Muhammad Usama Anjum @ 2026-08-25 11:18 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Vincenzo Frascino, Andrey Konovalov, Andrew Morton,
Amit Daniel Kachhap, Yeoreum Yun, Mark Brown, 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 these tests.
Add a fragment covering all tests in arm64.
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
Changes since v1:
- Move the config fragment to the arm64 directory.
- Add requirements shared by other arm64 selftests.
- Use the selftests/arm64 subject prefix.
---
tools/testing/selftests/arm64/config | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 tools/testing/selftests/arm64/config
diff --git a/tools/testing/selftests/arm64/config b/tools/testing/selftests/arm64/config
new file mode 100644
index 0000000000000..0fa9755853924
--- /dev/null
+++ b/tools/testing/selftests/arm64/config
@@ -0,0 +1,17 @@
+CONFIG_ARM64_BTI=y
+CONFIG_ARM64_GCS=y
+CONFIG_ARM64_MTE=y
+CONFIG_ARM64_POE=y
+CONFIG_ARM64_PTR_AUTH=y
+CONFIG_ARM64_SME=y
+CONFIG_ARM64_SVE=y
+CONFIG_ARM64_TAGGED_ADDR_ABI=y
+CONFIG_HUGETLBFS=y
+CONFIG_KSM=y
+CONFIG_PROC_FS=y
+CONFIG_SECCOMP=y
+CONFIG_SECCOMP_FILTER=y
+CONFIG_SHMEM=y
+CONFIG_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
--
2.47.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/4] selftests/arm64: Print missing MTE TAP headers
2026-08-25 11:18 ` [PATCH v3 1/4] selftests/arm64: Print missing MTE TAP headers Muhammad Usama Anjum
@ 2026-08-25 13:58 ` Mark Brown
2026-08-26 8:25 ` Vincenzo Frascino
1 sibling, 0 replies; 11+ messages in thread
From: Mark Brown @ 2026-08-25 13:58 UTC (permalink / raw)
To: Muhammad Usama Anjum
Cc: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Vincenzo Frascino, Andrey Konovalov, Andrew Morton,
Amit Daniel Kachhap, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
[-- Attachment #1: Type: text/plain, Size: 307 bytes --]
On Tue, Aug 25, 2026 at 12:18:34PM +0100, Muhammad Usama Anjum wrote:
> Most MTE tests set a TAP plan and emit results without first printing
> the TAP version header. Direct execution therefore starts with a plan
> such as "1..20" instead of "TAP version 13".
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/4] selftests/arm64: Treat KSM merge_across_nodes as optional
2026-08-25 11:18 ` [PATCH v3 2/4] selftests/arm64: Treat KSM merge_across_nodes as optional Muhammad Usama Anjum
@ 2026-08-25 14:00 ` Mark Brown
2026-08-26 8:26 ` Vincenzo Frascino
1 sibling, 0 replies; 11+ messages in thread
From: Mark Brown @ 2026-08-25 14:00 UTC (permalink / raw)
To: Muhammad Usama Anjum
Cc: Catalin Marinas, Will Deacon, Mark Rutland, Shuah Khan,
Vincenzo Frascino, Andrey Konovalov, Andrew Morton,
Amit Daniel Kachhap, Yeoreum Yun, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
[-- Attachment #1: Type: text/plain, Size: 470 bytes --]
On Tue, Aug 25, 2026 at 12:18:35PM +0100, Muhammad Usama Anjum wrote:
> The MTE KSM test requires write access to KSM sysfs but does not check
> that it is running as root. It also unconditionally saves, enables and
> restores the merge_across_nodes attribute. The kernel only creates this
> attribute when CONFIG_NUMA=y, so a non-NUMA kernel prints the following
> message three times even though every KSM subtest passes:
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/4] selftests/arm64: Print missing MTE TAP headers
2026-08-25 11:18 ` [PATCH v3 1/4] selftests/arm64: Print missing MTE TAP headers Muhammad Usama Anjum
2026-08-25 13:58 ` Mark Brown
@ 2026-08-26 8:25 ` Vincenzo Frascino
1 sibling, 0 replies; 11+ messages in thread
From: Vincenzo Frascino @ 2026-08-26 8:25 UTC (permalink / raw)
To: Muhammad Usama Anjum, Catalin Marinas, Will Deacon, Mark Rutland,
Shuah Khan, Andrey Konovalov, Andrew Morton, Amit Daniel Kachhap,
Yeoreum Yun, Mark Brown, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
On 25/08/2026 12:18, Muhammad Usama Anjum wrote:
> Most MTE tests set a TAP plan and emit results without first printing
> the TAP version header. Direct execution therefore starts with a plan
> such as "1..20" instead of "TAP version 13".
>
> The problem is particularly visible in the GCR_EL1 context-switch test.
> It prints its plan before forking 1,024 child processes. When stdout is
> fully buffered, the plan remains in the stdio buffer. Each child inherits
> the pending "1..1" line and flushes its copy from exit(), producing
> repeated plan lines.
>
> ksft_print_header() prints the TAP header and enables line buffering.
> Call it in every MTE test that is missing it. In the GCR_EL1 test, call
> it before the plan so the plan is flushed before the children are
> forked. In the remaining tests, call it before setup and prerequisite
> checks so early failures and whole-test skips also retain the header.
>
> Fixes: 29f080881601 ("kselftest/arm64: check GCR_EL1 after context switch")
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
...
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/4] selftests/arm64: Treat KSM merge_across_nodes as optional
2026-08-25 11:18 ` [PATCH v3 2/4] selftests/arm64: Treat KSM merge_across_nodes as optional Muhammad Usama Anjum
2026-08-25 14:00 ` Mark Brown
@ 2026-08-26 8:26 ` Vincenzo Frascino
1 sibling, 0 replies; 11+ messages in thread
From: Vincenzo Frascino @ 2026-08-26 8:26 UTC (permalink / raw)
To: Muhammad Usama Anjum, Catalin Marinas, Will Deacon, Mark Rutland,
Shuah Khan, Andrey Konovalov, Andrew Morton, Amit Daniel Kachhap,
Yeoreum Yun, Mark Brown, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
On 25/08/2026 12:18, Muhammad Usama Anjum wrote:
> The MTE KSM test requires write access to KSM sysfs but does not check
> that it is running as root. It also unconditionally saves, enables and
> restores the merge_across_nodes attribute. The kernel only creates this
> attribute when CONFIG_NUMA=y, so a non-NUMA kernel prints the following
> message three times even though every KSM subtest passes:
>
> # ERR: missing /sys/kernel/mm/ksm/merge_across_nodes
>
> Skip the test when it is not running as root. Check that the optional
> attribute is readable and writable, treating ENOENT as its expected
> absence on non-NUMA kernels and skipping the test for other access
> failures. Only save, enable and restore the attribute when it is
> available.
>
> Check MTE availability before the privilege and sysfs checks so systems
> without MTE retain the existing feature-unavailable skip result.
>
> This preserves the existing 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>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
...
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 3/4] selftests/arm64: Fix MTE prctl TAP plan
2026-08-25 11:18 ` [PATCH v3 3/4] selftests/arm64: Fix MTE prctl TAP plan Muhammad Usama Anjum
@ 2026-08-26 8:27 ` Vincenzo Frascino
0 siblings, 0 replies; 11+ messages in thread
From: Vincenzo Frascino @ 2026-08-26 8:27 UTC (permalink / raw)
To: Muhammad Usama Anjum, Catalin Marinas, Will Deacon, Mark Rutland,
Shuah Khan, Andrey Konovalov, Andrew Morton, Amit Daniel Kachhap,
Yeoreum Yun, Mark Brown, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
On 25/08/2026 12:18, 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>
> Fixes: 1f488fb91378 ("kselftest/arm64/mte: Add MTE_STORE_ONLY testcases")
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
...
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 4/4] selftests/arm64: Add MTE test config fragment
2026-08-25 11:18 ` [PATCH v3 4/4] selftests/arm64: Add MTE test config fragment Muhammad Usama Anjum
@ 2026-08-26 8:27 ` Vincenzo Frascino
0 siblings, 0 replies; 11+ messages in thread
From: Vincenzo Frascino @ 2026-08-26 8:27 UTC (permalink / raw)
To: Muhammad Usama Anjum, Catalin Marinas, Will Deacon, Mark Rutland,
Shuah Khan, Andrey Konovalov, Andrew Morton, Amit Daniel Kachhap,
Yeoreum Yun, Mark Brown, open list,
moderated list:ARM64 PORT (AARCH64 ARCHITECTURE),
open list:KERNEL SELFTEST FRAMEWORK
On 25/08/2026 12:18, 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 these tests.
>
> Add a fragment covering all tests in arm64.
>
> Reviewed-by: Mark Brown <broonie@kernel.org>
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
...
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-08-26 8:27 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25 11:18 [PATCH v3 0/4] selftests/arm64: Fix MTE test setup and TAP reporting Muhammad Usama Anjum
2026-08-25 11:18 ` [PATCH v3 1/4] selftests/arm64: Print missing MTE TAP headers Muhammad Usama Anjum
2026-08-25 13:58 ` Mark Brown
2026-08-26 8:25 ` Vincenzo Frascino
2026-08-25 11:18 ` [PATCH v3 2/4] selftests/arm64: Treat KSM merge_across_nodes as optional Muhammad Usama Anjum
2026-08-25 14:00 ` Mark Brown
2026-08-26 8:26 ` Vincenzo Frascino
2026-08-25 11:18 ` [PATCH v3 3/4] selftests/arm64: Fix MTE prctl TAP plan Muhammad Usama Anjum
2026-08-26 8:27 ` Vincenzo Frascino
2026-08-25 11:18 ` [PATCH v3 4/4] selftests/arm64: Add MTE test config fragment Muhammad Usama Anjum
2026-08-26 8:27 ` Vincenzo Frascino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox