arm64/fpsimd: Support FEAT_FPMR
authorMark Brown <broonie@kernel.org>
Wed, 6 Mar 2024 23:14:48 +0000 (23:14 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 7 Mar 2024 17:14:53 +0000 (17:14 +0000)
commit203f2b95a882dc46dd9873562167db69a1f61711
treed82d07afd47473957ef3921d6c09ac0551ce6ece
parentb6c0b424cb91a864e62533a6520743ddcdde5270
arm64/fpsimd: Support FEAT_FPMR

FEAT_FPMR defines a new EL0 accessible register FPMR use to configure the
FP8 related features added to the architecture at the same time. Detect
support for this register and context switch it for EL0 when present.

Due to the sharing of responsibility for saving floating point state
between the host kernel and KVM FP8 support is not yet implemented in KVM
and a stub similar to that used for SVCR is provided for FPMR in order to
avoid bisection issues. To make it easier to share host state with the
hypervisor we store FPMR as a hardened usercopy field in uw (along with
some padding).

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240306-arm64-2023-dpisa-v5-3-c568edc8ed7f@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/cpufeature.h
arch/arm64/include/asm/fpsimd.h
arch/arm64/include/asm/kvm_host.h
arch/arm64/include/asm/processor.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/fpsimd.c
arch/arm64/kvm/fpsimd.c
arch/arm64/tools/cpucaps