[PATCH 1/3] arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes

Will Deacon will at kernel.org
Thu Jul 20 03:52:36 PDT 2023


On Thu, Jul 13, 2023 at 09:06:04PM +0100, Mark Brown wrote:
> When we reconfigure the SVE vector length we discard the backing storage
> for the SVE vectors and then reallocate on next SVE use, leaving the SME
> specific state alone. This means that we do not enable SME traps if they
> were already disabled. That means that userspace code can enter streaming
> mode without trapping, putting the task in a state where if we try to save
> the state of the task we will fault.
> 
> Since the ABI does not specify that changing the SVE vector length disturbs
> SME state, and since SVE code may not be aware of SME code in the process,
> we shouldn't simply discard any ZA state. Instead immediately reallocate
> the storage for SVE if SME is active, and disable SME if we change the SVE
> vector length while there is no SME state active.

What is the advantage of keep the old behaviour in this case? In other
words, if it's acceptable to reallocate the state when SME is active, why
not just reallocate in all cases?

Will



More information about the linux-arm-kernel mailing list