summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2024-08-20 14:18:01 +0100
committerMarc Zyngier <maz@kernel.org>2024-08-27 07:59:27 +0100
commitc9150a8ad9cdb69584d4ec5af61481df41498eb8 (patch)
tree797116bc59e127c01083a0d562261f9f134acc2b /arch/arm64/kvm
parent6d7307651a8a021e7286e90264676b893cb6032d (diff)
downloadlinux-stable-c9150a8ad9cdb69584d4ec5af61481df41498eb8.tar.gz
linux-stable-c9150a8ad9cdb69584d4ec5af61481df41498eb8.tar.bz2
linux-stable-c9150a8ad9cdb69584d4ec5af61481df41498eb8.zip
KVM: arm64: Enable FP8 support when available and configured
If userspace has enabled FP8 support (by setting ID_AA64PFR2_EL1.FPMR to 1), let's enable the feature by setting HCRX_EL2.EnFPM for the vcpu. Reviewed-by: Mark Brown <broonie@kernel.org> Tested-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20240820131802.3547589-8-maz@kernel.org Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm')
-rw-r--r--arch/arm64/kvm/sys_regs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index 4c2f7c0af537..51627add0a72 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -4579,6 +4579,9 @@ void kvm_calculate_traps(struct kvm_vcpu *vcpu)
if (kvm_has_feat(kvm, ID_AA64MMFR3_EL1, TCRX, IMP))
vcpu->arch.hcrx_el2 |= HCRX_EL2_TCR2En;
+
+ if (kvm_has_fpmr(kvm))
+ vcpu->arch.hcrx_el2 |= HCRX_EL2_EnFPM;
}
if (test_bit(KVM_ARCH_FLAG_FGU_INITIALIZED, &kvm->arch.flags))