Skip to contentSkip to conversation

perf: arm64: Sync ESR_ELx_EC_* macros in arm64_exception_types.h with esr.h

PATCH Superseded Yunseong Kim 3 participants 4 messages Aug 14, 2025 – Aug 22, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: arm64: Sync ESR_ELx_EC_* macros in arm64_exception_types.h with esr.h

Update perf util arm64_exception_types.h to match the exception class macros defined in tools/arch/arm64/include/asm/esr.h. This ensures consistency between perf tooling and the kernel header definitions for ESR_ELx_EC_* values.

---
 tools/perf/arch/arm64/util/arm64_exception_types.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
tools/perf/arch/arm64/util/arm64_exception_types.h +6 -3
index 27c981ebe401..29931bf19062 100644
@@ -33,7 +33,7 @@
 #define ESR_ELx_EC_PAC		(0x09)	/* EL2 and above */
 /* Unallocated EC: 0x0A - 0x0B */
 #define ESR_ELx_EC_CP14_64	(0x0C)
-/* Unallocated EC: 0x0d */
+#define ESR_ELx_EC_BTI		(0x0D)
 #define ESR_ELx_EC_ILL		(0x0E)
 /* Unallocated EC: 0x0F - 0x10 */
 #define ESR_ELx_EC_SVC32	(0x11)
@@ -46,7 +46,10 @@
 #define ESR_ELx_EC_SYS64	(0x18)
 #define ESR_ELx_EC_SVE		(0x19)
 #define ESR_ELx_EC_ERET		(0x1a)	/* EL2 only */
-/* Unallocated EC: 0x1b - 0x1E */
+/* Unallocated EC: 0x1B */
+#define ESR_ELx_EC_FPAC		(0x1C)	/* EL1 and above */
+#define ESR_ELx_EC_SME		(0x1D)
+/* Unallocated EC: 0x1E */
 #define ESR_ELx_EC_IMP_DEF	(0x1f)	/* EL3 only */
 #define ESR_ELx_EC_IABT_LOW	(0x20)
 #define ESR_ELx_EC_IABT_CUR	(0x21)
@@ -55,7 +58,7 @@
 #define ESR_ELx_EC_DABT_LOW	(0x24)
 #define ESR_ELx_EC_DABT_CUR	(0x25)
 #define ESR_ELx_EC_SP_ALIGN	(0x26)
-/* Unallocated EC: 0x27 */
+#define ESR_ELx_EC_MOPS		(0x27)
 #define ESR_ELx_EC_FP_EXC32	(0x28)
 /* Unallocated EC: 0x29 - 0x2B */
 #define ESR_ELx_EC_FP_EXC64	(0x2C)
Signature · 1 line
2.50.0
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Yunseong Kim

Update perf util arm64_exception_types.h to match the exception class macros defined in tools/arch/arm64/include/asm/esr.h. This ensures consistency between perf tooling and the kernel header definitions for ESR_ELx_EC_* values.

---
 tools/perf/arch/arm64/util/arm64_exception_types.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

This looks consistent with asm/esr.h on arm64, so:

Will

#2 lore raw
In reply to Yunseong Kim

Hi,

Quoted 6 lines · Yunseong Kim

Update perf util arm64_exception_types.h to match the exception class macros defined in tools/arch/arm64/include/asm/esr.h. This ensures consistency between perf tooling and the kernel header definitions for ESR_ELx_EC_* values.

Thanks for working on this.

This patch still misses couple macros, please see below.

tools/perf/arch/arm64/util/arm64_exception_types.h line 34

Quoted 11 lines
---
 tools/perf/arch/arm64/util/arm64_exception_types.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
tools/perf/arch/arm64/util/arm64_exception_types.h +0 -0
index 27c981ebe401..29931bf19062 100644
@@ -33,7 +33,7 @@
 #define ESR_ELx_EC_PAC		(0x09)	/* EL2 and above */
 /* Unallocated EC: 0x0A - 0x0B */

#define ESR_ELx_EC_OTHER (0x0A)

Quoted 19 lines
tools/perf/arch/arm64/util/arm64_exception_types.h +5 -2
 #define ESR_ELx_EC_CP14_64	(0x0C)
-/* Unallocated EC: 0x0d */
+#define ESR_ELx_EC_BTI		(0x0D)
 #define ESR_ELx_EC_ILL		(0x0E)
 /* Unallocated EC: 0x0F - 0x10 */
 #define ESR_ELx_EC_SVC32	(0x11)
@@ -46,7 +46,10 @@
 #define ESR_ELx_EC_SYS64	(0x18)
 #define ESR_ELx_EC_SVE		(0x19)
 #define ESR_ELx_EC_ERET		(0x1a)	/* EL2 only */
-/* Unallocated EC: 0x1b - 0x1E */
+/* Unallocated EC: 0x1B */
+#define ESR_ELx_EC_FPAC		(0x1C)	/* EL1 and above */
+#define ESR_ELx_EC_SME		(0x1D)
+/* Unallocated EC: 0x1E */
 #define ESR_ELx_EC_IMP_DEF	(0x1f)	/* EL3 only */
 #define ESR_ELx_EC_IABT_LOW	(0x20)
 #define ESR_ELx_EC_IABT_CUR	(0x21)

tools/perf/arch/arm64/util/arm64_exception_types.h line 64

Quoted 8 lines
tools/perf/arch/arm64/util/arm64_exception_types.h +1 -1
@@ -55,7 +58,7 @@
 #define ESR_ELx_EC_DABT_LOW	(0x24)
 #define ESR_ELx_EC_DABT_CUR	(0x25)
 #define ESR_ELx_EC_SP_ALIGN	(0x26)
-/* Unallocated EC: 0x27 */
+#define ESR_ELx_EC_MOPS		(0x27)
 #define ESR_ELx_EC_FP_EXC32	(0x28)
 /* Unallocated EC: 0x29 - 0x2B */
 #define ESR_ELx_EC_FP_EXC64	(0x2C)

#define ESR_ELx_EC_GCS (0x2D)

Thanks,
Leo

Quoted 3 lines
Signature · 1 line
2.50.0
#3 lore raw

Thank you for the review Leo!

Quoted 8 lines · Leo Yan

Hi,

Quoted 5 lines · Yunseong Kim

Update perf util arm64_exception_types.h to match the exception class macros defined in tools/arch/arm64/include/asm/esr.h. This ensures consistency between perf tooling and the kernel header definitions for ESR_ELx_EC_* values.

Quoted 5 lines
Quoted 1 line

Thanks for working on this.

This patch still misses couple macros, please see below.

I nearly missed that. Appreciate your checking.

Quoted 44 lines

tools/perf/arch/arm64/util/arm64_exception_types.h line 34

Quoted 11 lines
---
 tools/perf/arch/arm64/util/arm64_exception_types.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
tools/perf/arch/arm64/util/arm64_exception_types.h +0 -0
index 27c981ebe401..29931bf19062 100644
@@ -33,7 +33,7 @@
 #define ESR_ELx_EC_PAC		(0x09)	/* EL2 and above */
 /* Unallocated EC: 0x0A - 0x0B */

#define ESR_ELx_EC_OTHER (0x0A)

Quoted 19 lines
tools/perf/arch/arm64/util/arm64_exception_types.h +5 -2
 #define ESR_ELx_EC_CP14_64	(0x0C)
-/* Unallocated EC: 0x0d */
+#define ESR_ELx_EC_BTI		(0x0D)
 #define ESR_ELx_EC_ILL		(0x0E)
 /* Unallocated EC: 0x0F - 0x10 */
 #define ESR_ELx_EC_SVC32	(0x11)
@@ -46,7 +46,10 @@
 #define ESR_ELx_EC_SYS64	(0x18)
 #define ESR_ELx_EC_SVE		(0x19)
 #define ESR_ELx_EC_ERET		(0x1a)	/* EL2 only */
-/* Unallocated EC: 0x1b - 0x1E */
+/* Unallocated EC: 0x1B */
+#define ESR_ELx_EC_FPAC		(0x1C)	/* EL1 and above */
+#define ESR_ELx_EC_SME		(0x1D)
+/* Unallocated EC: 0x1E */
 #define ESR_ELx_EC_IMP_DEF	(0x1f)	/* EL3 only */
 #define ESR_ELx_EC_IABT_LOW	(0x20)
 #define ESR_ELx_EC_IABT_CUR	(0x21)

tools/perf/arch/arm64/util/arm64_exception_types.h line 64

Quoted 8 lines
tools/perf/arch/arm64/util/arm64_exception_types.h +1 -1
@@ -55,7 +58,7 @@
 #define ESR_ELx_EC_DABT_LOW	(0x24)
 #define ESR_ELx_EC_DABT_CUR	(0x25)
 #define ESR_ELx_EC_SP_ALIGN	(0x26)
-/* Unallocated EC: 0x27 */
+#define ESR_ELx_EC_MOPS		(0x27)
 #define ESR_ELx_EC_FP_EXC32	(0x28)
 /* Unallocated EC: 0x29 - 0x2B */
 #define ESR_ELx_EC_FP_EXC64	(0x2C)

#define ESR_ELx_EC_GCS (0x2D)

Quoted 6 lines

Thanks,
Leo

Quoted 3 lines
Signature · 1 line
2.50.0

I’ve sent out patch v2, Thanks everyone!

Best regards,
Yunseong Kim