Skip to content

Commit b8f669b

Browse files
author
Marc Zyngier
committed
KVM: arm64: Honor trap routing for FPMR
HCRX_EL2.EnFPM controls the trapping of FPMR (as well as the validity of any FP8 instruction, but we don't really care about this last part). Describe the trap bit so that the exception can be reinjected in a NV guest. 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 ef3be86 commit b8f669b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arch/arm64/kvm/emulate-nested.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ enum cgt_group_id {
8383
CGT_CPTR_TAM,
8484
CGT_CPTR_TCPAC,
8585

86+
CGT_HCRX_EnFPM,
8687
CGT_HCRX_TCR2En,
8788

8889
/*
@@ -372,6 +373,12 @@ static const struct trap_bits coarse_trap_bits[] = {
372373
.mask = CPTR_EL2_TCPAC,
373374
.behaviour = BEHAVE_FORWARD_ANY,
374375
},
376+
[CGT_HCRX_EnFPM] = {
377+
.index = HCRX_EL2,
378+
.value = 0,
379+
.mask = HCRX_EL2_EnFPM,
380+
.behaviour = BEHAVE_FORWARD_ANY,
381+
},
375382
[CGT_HCRX_TCR2En] = {
376383
.index = HCRX_EL2,
377384
.value = 0,
@@ -1108,6 +1115,7 @@ static const struct encoding_to_trap_config encoding_to_cgt[] __initconst = {
11081115
SR_TRAP(SYS_CNTP_CTL_EL0, CGT_CNTHCTL_EL1PTEN),
11091116
SR_TRAP(SYS_CNTPCT_EL0, CGT_CNTHCTL_EL1PCTEN),
11101117
SR_TRAP(SYS_CNTPCTSS_EL0, CGT_CNTHCTL_EL1PCTEN),
1118+
SR_TRAP(SYS_FPMR, CGT_HCRX_EnFPM),
11111119
};
11121120

11131121
static DEFINE_XARRAY(sr_forward_xa);

0 commit comments

Comments
 (0)