[PATCH 2/3] kselftest/arm64: Fix test for streaming FPSIMD write in sve-ptrace

Mark Brown posted 3 patches 6 months, 3 weeks ago
There is a newer version of this series
[PATCH 2/3] kselftest/arm64: Fix test for streaming FPSIMD write in sve-ptrace
Posted by Mark Brown 6 months, 3 weeks ago
Since f916dd32a943 ("arm64/fpsimd: ptrace: Mandate SVE payload for
streaming-mode state") we do not support writing FPSIMD payload data when
writing NT_ARM_SSVE but the sve-ptrace test has an explicit test for
this being supported which was not updated to reflect the new behaviour.
Fix the test to expect a failure when writing FPSIMD data to the
streaming mode register set.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/sve-ptrace.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/arm64/fp/sve-ptrace.c b/tools/testing/selftests/arm64/fp/sve-ptrace.c
index c499d5789dd5..7e259907805b 100644
--- a/tools/testing/selftests/arm64/fp/sve-ptrace.c
+++ b/tools/testing/selftests/arm64/fp/sve-ptrace.c
@@ -301,8 +301,10 @@ static void ptrace_sve_fpsimd(pid_t child, const struct vec_type *type)
 			p[j] = j;
 	}
 
+	/* This should only succeed for SVE */
 	ret = set_sve(child, type, sve);
-	ksft_test_result(ret == 0, "%s FPSIMD set via SVE: %d\n",
+	ksft_test_result((type->regset == NT_ARM_SVE) == (ret == 0),
+			 "%s FPSIMD set via SVE: %d\n",
 			 type->name, ret);
 	if (ret)
 		goto out;

-- 
2.39.5
Re: [PATCH 2/3] kselftest/arm64: Fix test for streaming FPSIMD write in sve-ptrace
Posted by Mark Rutland 6 months, 3 weeks ago
On Fri, May 23, 2025 at 04:27:13PM +0100, Mark Brown wrote:
> Since f916dd32a943 ("arm64/fpsimd: ptrace: Mandate SVE payload for
> streaming-mode state") we do not support writing FPSIMD payload data when
> writing NT_ARM_SSVE but the sve-ptrace test has an explicit test for
> this being supported which was not updated to reflect the new behaviour.
> Fix the test to expect a failure when writing FPSIMD data to the
> streaming mode register set.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

> ---
>  tools/testing/selftests/arm64/fp/sve-ptrace.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/arm64/fp/sve-ptrace.c b/tools/testing/selftests/arm64/fp/sve-ptrace.c
> index c499d5789dd5..7e259907805b 100644
> --- a/tools/testing/selftests/arm64/fp/sve-ptrace.c
> +++ b/tools/testing/selftests/arm64/fp/sve-ptrace.c
> @@ -301,8 +301,10 @@ static void ptrace_sve_fpsimd(pid_t child, const struct vec_type *type)
>  			p[j] = j;
>  	}
>  
> +	/* This should only succeed for SVE */
>  	ret = set_sve(child, type, sve);
> -	ksft_test_result(ret == 0, "%s FPSIMD set via SVE: %d\n",
> +	ksft_test_result((type->regset == NT_ARM_SVE) == (ret == 0),
> +			 "%s FPSIMD set via SVE: %d\n",
>  			 type->name, ret);
>  	if (ret)
>  		goto out;
> 
> -- 
> 2.39.5
>