Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: Expand ESR_ELx_WFx_ISS_TI to match its ARMv8.7 definition

Starting with FEAT_WFXT in ARMv8.7, the TI field in the ISS
that is reported on a WFx trap is expanded by one bit to
allow the description of WFET and WFIT.

Special care is taken to exclude the WFxT bit from the mask
used to match WFI so that it also matches WFIT when trapped from
EL0.

Reviewed-by: Joey Gouly <joey.gouly@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20220419182755.601427-2-maz@kernel.org

+4 -2
+4 -2
arch/arm64/include/asm/esr.h
··· 133 133 #define ESR_ELx_CV (UL(1) << 24) 134 134 #define ESR_ELx_COND_SHIFT (20) 135 135 #define ESR_ELx_COND_MASK (UL(0xF) << ESR_ELx_COND_SHIFT) 136 - #define ESR_ELx_WFx_ISS_TI (UL(1) << 0) 136 + #define ESR_ELx_WFx_ISS_TI (UL(3) << 0) 137 + #define ESR_ELx_WFx_ISS_WFxT (UL(2) << 0) 137 138 #define ESR_ELx_WFx_ISS_WFI (UL(0) << 0) 138 139 #define ESR_ELx_WFx_ISS_WFE (UL(1) << 0) 139 140 #define ESR_ELx_xVC_IMM_MASK ((1UL << 16) - 1) ··· 147 146 #define DISR_EL1_ESR_MASK (ESR_ELx_AET | ESR_ELx_EA | ESR_ELx_FSC) 148 147 149 148 /* ESR value templates for specific events */ 150 - #define ESR_ELx_WFx_MASK (ESR_ELx_EC_MASK | ESR_ELx_WFx_ISS_TI) 149 + #define ESR_ELx_WFx_MASK (ESR_ELx_EC_MASK | \ 150 + (ESR_ELx_WFx_ISS_TI & ~ESR_ELx_WFx_ISS_WFxT)) 151 151 #define ESR_ELx_WFx_WFI_VAL ((ESR_ELx_EC_WFx << ESR_ELx_EC_SHIFT) | \ 152 152 ESR_ELx_WFx_ISS_WFI) 153 153