[PATCH] kselftest/arm64: abi: fix SVCR detection

Mark Brown broonie at kernel.org
Mon Dec 9 04:36:52 PST 2024


On Mon, Dec 09, 2024 at 06:52:37PM +0800, Weizhao Ouyang wrote:

> When using svcr_in to check ZA and Streaming Mode, we should make sure
> that the value in x2 is correct, otherwise it may trigger an Illegal
> instruction if FEAT_SVE and !FEAT_SME.

>  	// Set SVCR if we're doing SME
> -	cbz	x1, 1f
>  	adrp	x2, svcr_in
>  	ldr	x2, [x2, :lo12:svcr_in]
> +	cbz	x1, 1f
>  	msr	S3_3_C4_C2_2, x2

This is against an older verison of the code so wouldn't apply now.
It's not also checking the value of SVCR, this is checking the SME flag
passed in via x1.  You can see that the SVCR value is loaded into x2 but
the check is against x1.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20241209/9f228bdf/attachment.sig>


More information about the linux-arm-kernel mailing list