Skip to content

Commit 9eaa425

Browse files
committed
selftests/mm: skip test for non-LPA2 and non-LVA systems
JIRA: https://issues.redhat.com/browse/RHEL-130531 commit f556acc Author: Dev Jain <dev.jain@arm.com> Date: Thu Jul 18 10:55:04 2024 +0530 selftests/mm: skip test for non-LPA2 and non-LVA systems Post my improvement of the test in e4a4ba4 ("selftests/mm: va_high_addr_switch: dynamically initialize testcases to enable LPA2 testing"): The test begins to fail on 4k and 16k pages, on non-LPA2 systems. To reduce noise in the CI systems, let us skip the test when higher address space is not implemented. Link: https://lkml.kernel.org/r/20240718052504.356517-1-dev.jain@arm.com Fixes: e4a4ba4 ("selftests/mm: va_high_addr_switch: dynamically initialize testcases to enable LPA2 testing") Signed-off-by: Dev Jain <dev.jain@arm.com> Reviewed-by: Ryan Roberts <ryan.roberts@arm.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Chunyu Hu <chuhu@redhat.com>
1 parent 2e9e5d2 commit 9eaa425

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tools/testing/selftests/mm/va_high_addr_switch.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,28 @@ static int run_test(struct testcase *test, int count)
293293
return ret;
294294
}
295295

296+
#ifdef __aarch64__
297+
/* Check if userspace VA > 48 bits */
298+
static int high_address_present(void)
299+
{
300+
void *ptr = mmap((void *)(1UL << 50), 1, PROT_READ | PROT_WRITE,
301+
MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
302+
if (ptr == MAP_FAILED)
303+
return 0;
304+
305+
munmap(ptr, 1);
306+
return 1;
307+
}
308+
#endif
309+
296310
static int supported_arch(void)
297311
{
298312
#if defined(__powerpc64__)
299313
return 1;
300314
#elif defined(__x86_64__)
301315
return 1;
302316
#elif defined(__aarch64__)
303-
return 1;
317+
return high_address_present();
304318
#else
305319
return 0;
306320
#endif

0 commit comments

Comments
 (0)