arm64: Add ESR_ELx_FSC_ADDRSZ_L() helper
authorMarc Zyngier <maz@kernel.org>
Wed, 31 Jul 2024 09:54:04 +0000 (10:54 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 30 Aug 2024 11:04:20 +0000 (12:04 +0100)
Although we have helpers that encode the level of a given fault
type, the Address Size fault type is missing it.

While we're at it, fix the bracketting for ESR_ELx_FSC_ACCESS_L()
and ESR_ELx_FSC_PERM_L().

Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/esr.h

index 56c148890daf5c47b8cec1d0ccc29b084eafdca7..d79308c23ddb94e9f9e7ec1dbe57809aed81cfbe 100644 (file)
 #define ESR_ELx_FSC_SECC_TTW(n)        (0x1c + (n))
 
 /* Status codes for individual page table levels */
-#define ESR_ELx_FSC_ACCESS_L(n)        (ESR_ELx_FSC_ACCESS + n)
-#define ESR_ELx_FSC_PERM_L(n)  (ESR_ELx_FSC_PERM + n)
+#define ESR_ELx_FSC_ACCESS_L(n)        (ESR_ELx_FSC_ACCESS + (n))
+#define ESR_ELx_FSC_PERM_L(n)  (ESR_ELx_FSC_PERM + (n))
 
 #define ESR_ELx_FSC_FAULT_nL   (0x2C)
 #define ESR_ELx_FSC_FAULT_L(n) (((n) < 0 ? ESR_ELx_FSC_FAULT_nL : \
 
 /* ISS field definitions for exceptions taken in to Hyp */
 #define ESR_ELx_FSC_ADDRSZ     (0x00)
+#define ESR_ELx_FSC_ADDRSZ_L(n)        (ESR_ELx_FSC_ADDRSZ + (n))
 #define ESR_ELx_CV             (UL(1) << 24)
 #define ESR_ELx_COND_SHIFT     (20)
 #define ESR_ELx_COND_MASK      (UL(0xF) << ESR_ELx_COND_SHIFT)