]> git.baikalelectronics.ru Git - kernel.git/commit
arm64/sme: Implement ZA context switching
authorMark Brown <broonie@kernel.org>
Tue, 19 Apr 2022 11:22:23 +0000 (12:22 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 22 Apr 2022 17:51:02 +0000 (18:51 +0100)
commit51c9d2b6cdb6ecfc2ba44690c1aeb62f02506c11
treef5c437cd6e6c4cd3f0f5a8d7c0e690d5b358f6a2
parenta0d8a3499d6073c91254c83572dd37497df4bee7
arm64/sme: Implement ZA context switching

Allocate space for storing ZA on first access to SME and use that to save
and restore ZA state when context switching. We do this by using the vector
form of the LDR and STR ZA instructions, these do not require streaming
mode and have implementation recommendations that they avoid contention
issues in shared SMCU implementations.

Since ZA is architecturally guaranteed to be zeroed when enabled we do not
need to explicitly zero ZA, either we will be restoring from a saved copy
or trapping on first use of SME so we know that ZA must be disabled.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20220419112247.711548-16-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/fpsimd.h
arch/arm64/include/asm/fpsimdmacros.h
arch/arm64/include/asm/kvm_host.h
arch/arm64/include/asm/processor.h
arch/arm64/kernel/entry-fpsimd.S
arch/arm64/kernel/fpsimd.c
arch/arm64/kvm/fpsimd.c