[PATCH v2 3/4] arm64/sme: Don't flush SVE register state when allocating SME storage

Catalin Marinas catalin.marinas at arm.com
Wed Aug 17 07:27:10 PDT 2022


On Mon, Aug 15, 2022 at 02:28:33PM +0100, Mark Brown wrote:
> Currently when taking a SME access trap we allocate storage for the SVE
> register state in order to be able to handle storage of streaming mode SVE.
> Due to the original usage in a purely SVE context the SVE register state
> allocation this also flushes the register state for SVE if storage was
> already allocated but in the SME context this is not desirable. For a SME
> access trap to be taken the task must not be in streaming mode so either
> there already is SVE register state present for regular SVE mode which would
> be corrupted or the task does not have TIF_SVE and the flush is redundant.
> 
> Fix this by adding a flag to sve_alloc() indicating if we are in a SVE
> context and need to flush the state. Freshly allocated storage is always
> zeroed either way.
> 
> Fixes: 8bd7f91c03d88 ("arm64/sme: Implement traps and syscall handling for SME")
> Signed-off-by: Mark Brown <broonie at kernel.org>

Reviewed-by: Catalin Marinas <catalin.marinas at arm.com>



More information about the linux-arm-kernel mailing list