Skip to content

Commit 98dbe56

Browse files
author
Marc Zyngier
committed
KVM: arm64: Handle TSB CSYNC traps
The architecture introduces a trap for TSB CSYNC that fits in the same EC as LS64 and PSB CSYNC. Let's deal with it in a similar way. It's not that we expect this to be useful any time soon anyway. Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent af2d78d commit 98dbe56

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

arch/arm64/include/asm/esr.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,11 @@
182182
#define ESR_ELx_WFx_ISS_WFE (UL(1) << 0)
183183
#define ESR_ELx_xVC_IMM_MASK ((UL(1) << 16) - 1)
184184

185-
/* ISS definitions for LD64B/ST64B/PSBCSYNC instructions */
185+
/* ISS definitions for LD64B/ST64B/{T,P}SBCSYNC instructions */
186186
#define ESR_ELx_ISS_OTHER_ST64BV (0)
187187
#define ESR_ELx_ISS_OTHER_ST64BV0 (1)
188188
#define ESR_ELx_ISS_OTHER_LDST64B (2)
189+
#define ESR_ELx_ISS_OTHER_TSBCSYNC (3)
189190
#define ESR_ELx_ISS_OTHER_PSBCSYNC (4)
190191

191192
#define DISR_EL1_IDS (UL(1) << 24)

arch/arm64/kvm/emulate-nested.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,6 +2044,7 @@ static const union trap_config non_0x18_fgt[] __initconst = {
20442044
FGT(HFGITR, SVC_EL1, 1),
20452045
FGT(HFGITR, SVC_EL0, 1),
20462046
FGT(HFGITR, ERET, 1),
2047+
FGT(HFGITR2, TSBCSYNC, 1),
20472048
};
20482049

20492050
static union trap_config get_trap_config(u32 sysreg)

arch/arm64/kvm/handle_exit.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ static int handle_other(struct kvm_vcpu *vcpu)
347347
if (is_l2)
348348
fwd = !(hcrx & HCRX_EL2_EnALS);
349349
break;
350+
case ESR_ELx_ISS_OTHER_TSBCSYNC:
351+
allowed = kvm_has_feat(kvm, ID_AA64DFR0_EL1, TraceBuffer, TRBE_V1P1);
352+
if (is_l2)
353+
fwd = (__vcpu_sys_reg(vcpu, HFGITR2_EL2) & HFGITR2_EL2_TSBCSYNC);
354+
break;
350355
case ESR_ELx_ISS_OTHER_PSBCSYNC:
351356
allowed = kvm_has_feat(kvm, ID_AA64DFR0_EL1, PMSVer, V1P5);
352357
if (is_l2)

0 commit comments

Comments
 (0)