[PATCH v1 6/9] selftests/mm: va_high_addr_switch should skip unsupported arm64 configs

Ryan Roberts posted 9 patches 2 years, 7 months ago
There is a newer version of this series
[PATCH v1 6/9] selftests/mm: va_high_addr_switch should skip unsupported arm64 configs
Posted by Ryan Roberts 2 years, 7 months ago
va_high_addr_switch has a mechanism to determine if the tests should be
run or skipped (supported_arch()). This currently returns
unconditionally true for arm64. However, va_high_addr_switch also
requires a large virtual address space for the tests to run, otherwise
they spuriously fail.

Since arm64 can only support VA > 48 bits when the page size is 64K,
let's decide whether we should skip the test suite based on the page
size. This reduces noise when running on 4K and 16K kernels.

Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
---
 tools/testing/selftests/mm/va_high_addr_switch.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/va_high_addr_switch.c b/tools/testing/selftests/mm/va_high_addr_switch.c
index 7cfaf4a74c57..4b6f62c69a9d 100644
--- a/tools/testing/selftests/mm/va_high_addr_switch.c
+++ b/tools/testing/selftests/mm/va_high_addr_switch.c
@@ -292,7 +292,8 @@ static int supported_arch(void)
 #elif defined(__x86_64__)
 	return 1;
 #elif defined(__aarch64__)
-	return 1;
+	size_t page_size = getpagesize();
+	return page_size == PAGE_SIZE;
 #else
 	return 0;
 #endif
-- 
2.25.1
Re: [PATCH v1 6/9] selftests/mm: va_high_addr_switch should skip unsupported arm64 configs
Posted by David Hildenbrand 2 years, 7 months ago
On 13.07.23 15:54, Ryan Roberts wrote:
> va_high_addr_switch has a mechanism to determine if the tests should be
> run or skipped (supported_arch()). This currently returns
> unconditionally true for arm64. However, va_high_addr_switch also
> requires a large virtual address space for the tests to run, otherwise
> they spuriously fail.
> 
> Since arm64 can only support VA > 48 bits when the page size is 64K,
> let's decide whether we should skip the test suite based on the page
> size. This reduces noise when running on 4K and 16K kernels.
> 
> Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
> ---
>   tools/testing/selftests/mm/va_high_addr_switch.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/mm/va_high_addr_switch.c b/tools/testing/selftests/mm/va_high_addr_switch.c
> index 7cfaf4a74c57..4b6f62c69a9d 100644
> --- a/tools/testing/selftests/mm/va_high_addr_switch.c
> +++ b/tools/testing/selftests/mm/va_high_addr_switch.c
> @@ -292,7 +292,8 @@ static int supported_arch(void)
>   #elif defined(__x86_64__)
>   	return 1;
>   #elif defined(__aarch64__)
> -	return 1;
> +	size_t page_size = getpagesize();
> +	return page_size == PAGE_SIZE;


return getpagesize() == PAGE_SIZE;

?


Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb