[PATCH v5 0/8] arm64/sve: Clean up KVM integration and optimise syscalls

Will Deacon will at kernel.org
Tue Nov 29 11:52:45 PST 2022


On Tue, 15 Nov 2022 09:46:32 +0000, Mark Brown wrote:
> This patch series attempts to clarify the tracking of which set of
> floating point registers we save on systems supporting SVE, particularly
> with reference to KVM, and then uses the results of this clarification
> to improve the performance of simple syscalls where we return directly
> to userspace in cases where userspace is using SVE.
> 
> At present we track which register state is active by using the TIF_SVE
> flag for the current task which also controls if userspace is able to
> use SVE, this is reasonably straightforward if limiting but for KVM it
> gets a bit hairy since we may have guest state loaded in registers. This
> results in KVM modifying TIF_SVE for the VMM task while the guest is
> running which doesn't entirely help make things easy to follow. To help
> make things clearer the series changes things so that in addition to
> TIF_SVE we explicitly track both the type of registers that are
> currently saved in the task struct and the type of registers that we
> should save when we do so. TIF_SVE then solely controls if userspace
> can use SVE without trapping, it has no function for KVM guests and we
> can remove the code for managing it from KVM.
> 
> [...]

Applied to arm64 (for-next/sve-state), thanks!

[1/8] KVM: arm64: Discard any SVE state when entering KVM guests
      https://git.kernel.org/arm64/c/93ae6b01bafe
[2/8] arm64/fpsimd: Track the saved FPSIMD state type separately to TIF_SVE
      https://git.kernel.org/arm64/c/baa8515281b3
[3/8] arm64/fpsimd: Have KVM explicitly say which FP registers to save
      https://git.kernel.org/arm64/c/deeb8f9a80fd
[4/8] arm64/fpsimd: Stop using TIF_SVE to manage register saving in KVM
      https://git.kernel.org/arm64/c/62021cc36add
[5/8] arm64/fpsimd: Load FP state based on recorded data type
      https://git.kernel.org/arm64/c/a0136be443d5
[6/8] arm64/fpsimd: SME no longer requires SVE register state
      https://git.kernel.org/arm64/c/bbc6172eefdb
[7/8] arm64/sve: Leave SVE enabled on syscall if we don't context switch
      https://git.kernel.org/arm64/c/8c845e273104
[8/8] arm64/fp: Use a struct to pass data to fpsimd_bind_state_to_cpu()
      https://git.kernel.org/arm64/c/1192b93ba352

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev



More information about the linux-arm-kernel mailing list