Skip to content

Commit 397411c

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

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
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 instructions */
185+
/* ISS definitions for LD64B/ST64B/PSBCSYNC 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_PSBCSYNC (4)
189190

190191
#define DISR_EL1_IDS (UL(1) << 24)
191192
/*

arch/arm64/kvm/emulate-nested.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,6 +2000,7 @@ static const struct encoding_to_trap_config encoding_to_fgt[] __initconst = {
20002000
* trap is handled somewhere else.
20012001
*/
20022002
static const union trap_config non_0x18_fgt[] __initconst = {
2003+
FGT(HFGITR, PSBCSYNC, 1),
20032004
FGT(HFGITR, nGCSSTR_EL1, 0),
20042005
FGT(HFGITR, SVC_EL1, 1),
20052006
FGT(HFGITR, SVC_EL0, 1),

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_PSBCSYNC:
351+
allowed = kvm_has_feat(kvm, ID_AA64DFR0_EL1, PMSVer, V1P5);
352+
if (is_l2)
353+
fwd = (__vcpu_sys_reg(vcpu, HFGITR_EL2) & HFGITR_EL2_PSBCSYNC);
354+
break;
350355
default:
351356
/* Clearly, we're missing something. */
352357
WARN_ON_ONCE(1);

arch/arm64/tools/sysreg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3406,7 +3406,7 @@ Field 0 AFSR0_EL1
34063406
EndSysreg
34073407

34083408
Sysreg HFGITR_EL2 3 4 1 1 6
3409-
Res0 63
3409+
Field 63 PSBCSYNC
34103410
Field 62 ATS1E1A
34113411
Res0 61
34123412
Field 60 COSPRCTX

0 commit comments

Comments
 (0)