Skip to contentSkip to conversation

selftests/mm: sigbus-wp test requires UFFD_FEATURE_WP_HUGETLBFS_SHMEM

PATCH Applied Edward Liaw 2 participants 2 messages Mar 21, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/mm: sigbus-wp test requires UFFD_FEATURE_WP_HUGETLBFS_SHMEM

The sigbus-wp test requires the UFFD_FEATURE_WP_HUGETLBFS_SHMEM flag for shmem and hugetlb targets. Otherwise it is not backwards compatible with kernels <5.19 and fails with EINVAL.

---
 tools/testing/selftests/mm/uffd-unit-tests.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/mm/uffd-unit-tests.c +2 -1
index 4a48dc617c6b..21ec23206ab4 100644
@@ -1437,7 +1437,8 @@ uffd_test_case_t uffd_tests[] = {
 		.uffd_fn = uffd_sigbus_wp_test,
 		.mem_targets = MEM_ALL,
 		.uffd_feature_required = UFFD_FEATURE_SIGBUS |
-		UFFD_FEATURE_EVENT_FORK | UFFD_FEATURE_PAGEFAULT_FLAG_WP,
+		UFFD_FEATURE_EVENT_FORK | UFFD_FEATURE_PAGEFAULT_FLAG_WP |
+		UFFD_FEATURE_WP_HUGETLBFS_SHMEM,
 	},
 	{
 		.name = "events",
Signature · 1 line
2.44.0.396.g6e790dbe36-goog
maintainer
#1 lore raw
Quoted 9 lines · On Thu, 21 Mar 2024 23:20:21 +0000 Edward Liaw <[email protected]> wrote:

The sigbus-wp test requires the UFFD_FEATURE_WP_HUGETLBFS_SHMEM flag for shmem and hugetlb targets. Otherwise it is not backwards compatible with kernels <5.19 and fails with EINVAL.

...

tools/testing/selftests/mm/uffd-unit-tests.c uffd_test_case_t uffd_tests[] = { · line 1444

Quoted 9 lines
tools/testing/selftests/mm/uffd-unit-tests.c +2 -1
@@ -1437,7 +1437,8 @@ uffd_test_case_t uffd_tests[] = {
 		.uffd_fn = uffd_sigbus_wp_test,
 		.mem_targets = MEM_ALL,
 		.uffd_feature_required = UFFD_FEATURE_SIGBUS |
-		UFFD_FEATURE_EVENT_FORK | UFFD_FEATURE_PAGEFAULT_FLAG_WP,
+		UFFD_FEATURE_EVENT_FORK | UFFD_FEATURE_PAGEFAULT_FLAG_WP |
+		UFFD_FEATURE_WP_HUGETLBFS_SHMEM,
 	},
 	{
 		.name = "events",

Thanks, I'll add

Fixes 73c1ea939b65 ("selftests/mm: move uffd sig/events tests into uffd unit tests")