[PATCH v4 7/8] arm64/sve: Leave SVE enabled on syscall if we don't context switch

Catalin Marinas catalin.marinas at arm.com
Mon Nov 14 02:31:17 PST 2022


On Sat, Oct 22, 2022 at 12:03:20AM +0100, Mark Brown wrote:
> The syscall ABI says that the SVE register state not shared with FPSIMD
> may not be preserved on syscall, and this is the only mechanism we have
> in the ABI to stop tracking the extra SVE state for a process. Currently
> we do this unconditionally by means of disabling SVE for the process on
> syscall, causing userspace to take a trap to EL1 if it uses SVE again.
> These extra traps result in a noticeable overhead for using SVE instead
> of FPSIMD in some workloads, especially for simple syscalls where we can
> return directly to userspace and would not otherwise need to update the
> floating point registers. Tests with fp-pidbench show an approximately
> 70% overhead on a range of implementations when SVE is in use - while
> this is an extreme and entirely artificial benchmark it is clear that
> there is some useful room for improvement here.

If SVE is no longer in use, does the explicit SVE regs flushing cause
any noticeable overhead? I guess even if there's a small overhead, it's
only temporary until a context switch clears TIF_SVE again.

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



More information about the linux-arm-kernel mailing list