Skip to content

Commit 4ee5d5f

Browse files
committed
KVM: arm64: nv: Honor MDCR_EL2.{TPM, TPMCR} in Host EL0
TPM and TPMCR trap bits also affect Host EL0. How fun. Mark these two trap bits as such and take advantage of the new infrastructure for dealing w/ EL0 traps. Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent d97e66f commit 4ee5d5f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/arm64/kvm/emulate-nested.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,15 @@ static const struct trap_bits coarse_trap_bits[] = {
304304
.index = MDCR_EL2,
305305
.value = MDCR_EL2_TPMCR,
306306
.mask = MDCR_EL2_TPMCR,
307-
.behaviour = BEHAVE_FORWARD_RW,
307+
.behaviour = BEHAVE_FORWARD_RW |
308+
BEHAVE_FORWARD_IN_HOST_EL0,
308309
},
309310
[CGT_MDCR_TPM] = {
310311
.index = MDCR_EL2,
311312
.value = MDCR_EL2_TPM,
312313
.mask = MDCR_EL2_TPM,
313-
.behaviour = BEHAVE_FORWARD_RW,
314+
.behaviour = BEHAVE_FORWARD_RW |
315+
BEHAVE_FORWARD_IN_HOST_EL0,
314316
},
315317
[CGT_MDCR_TDE] = {
316318
.index = MDCR_EL2,

0 commit comments

Comments
 (0)