[PATCH] arm64: sme: Use STR P to clear FFR context field in streaming SVE mode

Mark Brown broonie at kernel.org
Wed Jun 28 10:04:06 PDT 2023


On Wed, Jun 28, 2023 at 04:56:05PM +0100, Will Deacon wrote:
> The FFR is a predicate register which can vary between 16 and 256 bits
> in size depending upon the configured vector length. When saving the
> SVE state in streaming SVE mode, the FFR register is inaccessible and
> so commit 9f5848665788 ("arm64/sve: Make access to FFR optional") simply
> clears the FFR field of the in-memory context structure. Unfortunately,
> it achieves this using an unconditional 8-byte store and so if the SME
> vector length is anything other than 64 bytes in size we will either
> fail to clear the entire field or, worse, we will corrupt memory
> immediately following the structure. This has led to intermittent kfence
> splats in CI [1] and can trigger kmalloc Redzone corruption messages
> when running the 'fp-stress' kselftest:

Reviewed-by: Mark Brown <broonie at kernel.org>
-------------- 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/20230628/c561c486/attachment.sig>


More information about the linux-arm-kernel mailing list