Skip to content

Commit f556acc

Browse files
Dev Jainakpm00
authored andcommitted
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/[email protected] Fixes: e4a4ba4 ("selftests/mm: va_high_addr_switch: dynamically initialize testcases to enable LPA2 testing") Signed-off-by: Dev Jain <[email protected]> Reviewed-by: Ryan Roberts <[email protected]> Cc: Anshuman Khandual <[email protected]> Cc: Mark Brown <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 66eca10 commit f556acc

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)