[PATCH 03/11] kselftest/arm64: Move exit calls out of fp-stress loads

Mark Rutland mark.rutland at arm.com
Tue Sep 29 09:27:28 PDT 2026


On Tue, Sep 01, 2026 at 06:06:43PM +0100, Mark Brown wrote:
> When they detect corruption the fp-stress test loads print load specific
> diagnostics and exits with a failure status.  In preparation for
> building versions intended to run as KVM guests factor the exits into
> asm-utils-linux.S.
> 
> No functional change.

This is a good cleanup, but I do think it'd be worth noting that some of
the existing asm was wrong and worked by coincidence.

I did mention that in the patches I linked you to a while back:

  https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/commit/?id=922d15ef46cb486a79f168949e103f6df26f4fba

Mark.

> 
> Signed-off-by: Mark Brown <broonie at kernel.org>
> ---
>  tools/testing/selftests/arm64/fp/asm-utils-linux.S | 8 ++++++++
>  tools/testing/selftests/arm64/fp/fpsimd-test.S     | 4 +---
>  tools/testing/selftests/arm64/fp/sve-test.S        | 8 ++------
>  tools/testing/selftests/arm64/fp/za-test.S         | 8 ++------
>  tools/testing/selftests/arm64/fp/zt-test.S         | 4 +---
>  5 files changed, 14 insertions(+), 18 deletions(-)
> 
> diff --git a/tools/testing/selftests/arm64/fp/asm-utils-linux.S b/tools/testing/selftests/arm64/fp/asm-utils-linux.S
> index 3effeb1fbf50..9cd31dc47709 100644
> --- a/tools/testing/selftests/arm64/fp/asm-utils-linux.S
> +++ b/tools/testing/selftests/arm64/fp/asm-utils-linux.S
> @@ -84,3 +84,11 @@ function tickle_handler
>  	ret
>  endfunction
>  .globl	tickle_handler
> +
> +// Terminate the program, reporting failure.  Does not return.
> +function exit_error
> +	mov	x0, #1
> +	mov	x8, #__NR_exit
> +	svc	#0
> +endfunction
> +.globl	exit_error
> diff --git a/tools/testing/selftests/arm64/fp/fpsimd-test.S b/tools/testing/selftests/arm64/fp/fpsimd-test.S
> index 9db7b5419397..5ee8ef51ea4e 100644
> --- a/tools/testing/selftests/arm64/fp/fpsimd-test.S
> +++ b/tools/testing/selftests/arm64/fp/fpsimd-test.S
> @@ -298,7 +298,5 @@ function barf
>  	bl	dumphex
>  	puts	"]\n"
>  
> -	mov	x8, #__NR_exit
> -	mov	x1, #1
> -	svc	#0
> +	b	exit_error
>  endfunction
> diff --git a/tools/testing/selftests/arm64/fp/sve-test.S b/tools/testing/selftests/arm64/fp/sve-test.S
> index 2aadb5c3c0f3..3447fe0e5554 100644
> --- a/tools/testing/selftests/arm64/fp/sve-test.S
> +++ b/tools/testing/selftests/arm64/fp/sve-test.S
> @@ -543,9 +543,7 @@ function vl_barf
>  	mov	x0, x10
>  	bl	putdecn
>  
> -	mov	x8, #__NR_exit
> -	mov	x1, #1
> -	svc	#0
> +	b	exit_error
>  endfunction
>  
>  function svcr_barf
> @@ -555,7 +553,5 @@ function svcr_barf
>  	mov	x0, x10
>  	bl	putdecn
>  
> -	mov	x8, #__NR_exit
> -	mov	x1, #1
> -	svc	#0
> +	b	exit_error
>  endfunction
> diff --git a/tools/testing/selftests/arm64/fp/za-test.S b/tools/testing/selftests/arm64/fp/za-test.S
> index 84e63e510f23..33dc4ce8bfa1 100644
> --- a/tools/testing/selftests/arm64/fp/za-test.S
> +++ b/tools/testing/selftests/arm64/fp/za-test.S
> @@ -354,9 +354,7 @@ function vl_barf
>  	mov	x0, x10
>  	bl	putdecn
>  
> -	mov	x8, #__NR_exit
> -	mov	x1, #1
> -	svc	#0
> +	b	exit_error
>  endfunction
>  
>  function svcr_barf
> @@ -366,7 +364,5 @@ function svcr_barf
>  	mov	x0, x10
>  	bl	putdecn
>  
> -	mov	x8, #__NR_exit
> -	mov	x1, #1
> -	svc	#0
> +	b	exit_error
>  endfunction
> diff --git a/tools/testing/selftests/arm64/fp/zt-test.S b/tools/testing/selftests/arm64/fp/zt-test.S
> index afcadb5aff23..c67242c2d5ab 100644
> --- a/tools/testing/selftests/arm64/fp/zt-test.S
> +++ b/tools/testing/selftests/arm64/fp/zt-test.S
> @@ -284,7 +284,5 @@ function svcr_barf
>  	mov	x0, x10
>  	bl	putdecn
>  
> -	mov	x8, #__NR_exit
> -	mov	x1, #1
> -	svc	#0
> +	b	exit_error
>  endfunction
> 
> -- 
> 2.47.3
> 



More information about the linux-arm-kernel mailing list