Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/mm: skip test for non-LPA2 and non-LVA systems

Post my improvement of the test in e4a4ba415419 ("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: e4a4ba415419 ("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>

authored by

Dev Jain and committed by
Andrew Morton
f556acc2 66eca102

+15 -1
+15 -1
tools/testing/selftests/mm/va_high_addr_switch.c
··· 293 293 return ret; 294 294 } 295 295 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 + 296 310 static int supported_arch(void) 297 311 { 298 312 #if defined(__powerpc64__) ··· 314 300 #elif defined(__x86_64__) 315 301 return 1; 316 302 #elif defined(__aarch64__) 317 - return 1; 303 + return high_address_present(); 318 304 #else 319 305 return 0; 320 306 #endif