1From cee5b1e7290443c472b3fa379212076dc45242fd Mon Sep 17 00:00:00 2001
2From: Edward Liaw <[email protected]>
3Date: Thu, 12 Oct 2023 22:01:34 +0000
4Subject: [PATCH] Revert "selftests/uffd: enable uffd-wp for shmem/hugetlbfs"
5
6This reverts commit c0eeeb02d9df878c71a457008900b650d94bd0d9.
7
8Reason for revert: uffd-wp support is only from >5.19 of the kernel.  It
9will fail on most of the active Android kernels
10
11Bug: 303675116
12Test: atest vts_linux_kselftest_arm_64:vm_userfaultfd_shmem_arm_64
13Signed-off-by: Edward Liaw <[email protected]>
14---
15 tools/testing/selftests/vm/userfaultfd.c | 4 +++-
16 1 file changed, 3 insertions(+), 1 deletion(-)
17
18diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
19index 02cc35b65a7a..20f0e1ff4635 100644
20--- a/tools/testing/selftests/vm/userfaultfd.c
21+++ b/tools/testing/selftests/vm/userfaultfd.c
22@@ -90,7 +90,7 @@ static bool test_dev_userfaultfd;
23 static volatile bool test_uffdio_copy_eexist = true;
24 static volatile bool test_uffdio_zeropage_eexist = true;
25 /* Whether to test uffd write-protection */
26-static bool test_uffdio_wp = true;
27+static bool test_uffdio_wp = false;
28 /* Whether to test uffd minor faults */
29 static bool test_uffdio_minor = false;
30
31@@ -1764,6 +1764,8 @@ static void set_test_type(const char *type)
32 	if (!strcmp(type, "anon")) {
33 		test_type = TEST_ANON;
34 		uffd_test_ops = &anon_uffd_test_ops;
35+		/* Only enable write-protect test for anonymous test */
36+		test_uffdio_wp = true;
37 	} else if (!strcmp(type, "hugetlb")) {
38 		test_type = TEST_HUGETLB;
39 		uffd_test_ops = &hugetlb_uffd_test_ops;
40--
412.42.0.655.g421f12c284-goog
42
43