arm64/sve: Explicitly load vector length when restoring SVE state
authorMark Brown <broonie@kernel.org>
Tue, 19 Oct 2021 17:22:13 +0000 (18:22 +0100)
committerWill Deacon <will@kernel.org>
Thu, 21 Oct 2021 09:18:17 +0000 (10:18 +0100)
commitddc806b5c4752d35bdaa4dfa2aaa72785711a3da
tree7902423b7289171ea41c732e7077f5dd0d17a510
parentb5bc00ffddc08c20a799514cbcfd2abaa6718014
arm64/sve: Explicitly load vector length when restoring SVE state

Currently when restoring the SVE state we supply the SVE vector length
as an argument to sve_load_state() and the underlying macros. This becomes
inconvenient with the addition of SME since we may need to restore any
combination of SVE and SME vector lengths, and we already separately
restore the vector length in the KVM code. We don't need to know the vector
length during the actual register load since the SME load instructions can
index into the data array for us.

Refactor the interface so we explicitly set the vector length separately
to restoring the SVE registers in preparation for adding SME support, no
functional change should be involved.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211019172247.3045838-9-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/fpsimd.h
arch/arm64/include/asm/fpsimdmacros.h
arch/arm64/kernel/entry-fpsimd.S
arch/arm64/kernel/fpsimd.c
arch/arm64/kvm/hyp/fpsimd.S