[PATCH 3/6] kselftest/arm64: Corrupt P15 in the irritator when testing SSVE

Mark Brown posted 6 patches 1 month ago
There is a newer version of this series
[PATCH 3/6] kselftest/arm64: Corrupt P15 in the irritator when testing SSVE
Posted by Mark Brown 1 month ago
When building for streaming SVE the irritator for SVE skips updates of both
P15 and FFR. While FFR is skipped since it might not be present there is no
reason to skip corrupting P15 so move the ifdef appropriately.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/sve-test.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/arm64/fp/sve-test.S b/tools/testing/selftests/arm64/fp/sve-test.S
index f1fb9745c681786f686f1fafcb7e1154f3c8e1a3..3c88dfe9c8cad29f44217314aeaffa984bac05e5 100644
--- a/tools/testing/selftests/arm64/fp/sve-test.S
+++ b/tools/testing/selftests/arm64/fp/sve-test.S
@@ -302,9 +302,9 @@ function irritator_handler
 	movi	v0.8b, #1
 	movi	v9.16b, #2
 	movi	v31.8b, #3
-#ifndef SSVE
 	// And P0
 	rdffr	p0.b
+#ifndef SSVE
 	// And FFR
 	wrffr	p15.b
 #endif

-- 
2.39.2
Re: [PATCH 3/6] kselftest/arm64: Corrupt P15 in the irritator when testing SSVE
Posted by Mark Rutland 2 weeks, 5 days ago
On Wed, Oct 23, 2024 at 09:38:31PM +0100, Mark Brown wrote:
> When building for streaming SVE the irritator for SVE skips updates of both
> P15 and FFR. While FFR is skipped since it might not be present there is no
> reason to skip corrupting P15 so move the ifdef appropriately.

I think you mean P0 rather than P15 here? 

	rdffr   p0.b

... reads from the FFR and writes to P0, modifying P0.

	wrffr   p15.b

... reads from P15 and writes to the FRR, leaving P15 unchanged.

> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  tools/testing/selftests/arm64/fp/sve-test.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/arm64/fp/sve-test.S b/tools/testing/selftests/arm64/fp/sve-test.S
> index f1fb9745c681786f686f1fafcb7e1154f3c8e1a3..3c88dfe9c8cad29f44217314aeaffa984bac05e5 100644
> --- a/tools/testing/selftests/arm64/fp/sve-test.S
> +++ b/tools/testing/selftests/arm64/fp/sve-test.S
> @@ -302,9 +302,9 @@ function irritator_handler
>  	movi	v0.8b, #1
>  	movi	v9.16b, #2
>  	movi	v31.8b, #3
> -#ifndef SSVE
>  	// And P0
>  	rdffr	p0.b
> +#ifndef SSVE
>  	// And FFR
>  	wrffr	p15.b
>  #endif

Both RDFFR and WRFFR are illegal in streaming mode unless FEAT_FA64 is
implemented and enabled, so we cannot use DRFFR in the SSVE case.

Is there a different instruction we can use?

Mark.
Re: [PATCH 3/6] kselftest/arm64: Corrupt P15 in the irritator when testing SSVE
Posted by Mark Brown 2 weeks, 5 days ago
On Wed, Nov 06, 2024 at 11:27:24AM +0000, Mark Rutland wrote:

> > +#ifndef SSVE
> >  	// And FFR
> >  	wrffr	p15.b
> >  #endif

> Both RDFFR and WRFFR are illegal in streaming mode unless FEAT_FA64 is
> implemented and enabled, so we cannot use DRFFR in the SSVE case.

Indeed, I'm surprised that managed to pass my testing...

> Is there a different instruction we can use?

We could just trash p0 with something like a load or add.