Skip to content

Commit 13c7a51

Browse files
author
Marc Zyngier
committed
KVM: arm64: Expose ID_AA64PFR2_EL1 to userspace and guests
Everything is now in place for a guest to "enjoy" FP8 support. Expose ID_AA64PFR2_EL1 to both userspace and guests, with the explicit restriction of only being able to clear FPMR. All other features (MTE* at the time of writing) are hidden and not writable. Reviewed-by: Mark Brown <[email protected]> Tested-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent c9150a8 commit 13c7a51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/arm64/kvm/sys_regs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,10 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu,
15391539

15401540
val &= ~ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_SME);
15411541
break;
1542+
case SYS_ID_AA64PFR2_EL1:
1543+
/* We only expose FPMR */
1544+
val &= ID_AA64PFR2_EL1_FPMR;
1545+
break;
15421546
case SYS_ID_AA64ISAR1_EL1:
15431547
if (!vcpu_has_ptrauth(vcpu))
15441548
val &= ~(ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_APA) |
@@ -2381,7 +2385,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
23812385
ID_AA64PFR0_EL1_AdvSIMD |
23822386
ID_AA64PFR0_EL1_FP), },
23832387
ID_SANITISED(ID_AA64PFR1_EL1),
2384-
ID_UNALLOCATED(4,2),
2388+
ID_WRITABLE(ID_AA64PFR2_EL1, ID_AA64PFR2_EL1_FPMR),
23852389
ID_UNALLOCATED(4,3),
23862390
ID_WRITABLE(ID_AA64ZFR0_EL1, ~ID_AA64ZFR0_EL1_RES0),
23872391
ID_HIDDEN(ID_AA64SMFR0_EL1),

0 commit comments

Comments
 (0)