From 9c17687aabc9e64a26575d5662ef273185d9d275 Mon Sep 17 00:00:00 2001 From: Vinoj Soundararajan Date: Thu, 1 Aug 2024 18:50:23 +0000 Subject: [PATCH 1/4] fix(ras): fix status synchronous error type fields Based on SET bits of ISS encoding for an exception from Data or Instruction Abort. (Refer to ESR_EL3) 1. Fix Synchronous error type restartable value from 1 to 3 2. Remove corrected CE field which is not applicable to SET Change-Id: If357da9881bee962825bc3b9423ba7fc107f9b1d Signed-off-by: Vinoj Soundararajan --- include/lib/extensions/ras_arch.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/lib/extensions/ras_arch.h b/include/lib/extensions/ras_arch.h index e0aee50e6..fc3f42608 100644 --- a/include/lib/extensions/ras_arch.h +++ b/include/lib/extensions/ras_arch.h @@ -148,9 +148,8 @@ /* Error types for Synchronous exceptions */ #define ERROR_STATUS_SET_UER 0x0 /* Recoverable */ -#define ERROR_STATUS_SET_UEO 0x1 /* Restable */ #define ERROR_STATUS_SET_UC 0x2 /* Uncontainable */ -#define ERROR_STATUS_SET_CE 0x3 /* Corrected */ +#define ERROR_STATUS_SET_UEO 0x3 /* Restartable */ /* Number of architecturally-defined primary error codes */ #define ERROR_STATUS_NUM_SERR U(22) From e5cd3e81d11cb7f9439e5077cf9063e30fc8c2ae Mon Sep 17 00:00:00 2001 From: Vinoj Soundararajan Date: Thu, 1 Aug 2024 18:56:19 +0000 Subject: [PATCH 2/4] fix(ras): fix typo in uncorrectable error type UEO Fix spelling for UEO from restable to restartable based on PE error state recording in the exception syndrome Refer to https://developer.arm.com/documentation/ddi0487/latest/ RAS PE architecture. Change-Id: I4da419f2120a7385853d4da78b409c675cdfe1c8 Signed-off-by: Vinoj Soundararajan --- include/lib/extensions/ras_arch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/lib/extensions/ras_arch.h b/include/lib/extensions/ras_arch.h index fc3f42608..941ed71ea 100644 --- a/include/lib/extensions/ras_arch.h +++ b/include/lib/extensions/ras_arch.h @@ -143,7 +143,7 @@ /* Uncorrected error types for Asynchronous exceptions */ #define ERROR_STATUS_UET_UC 0x0 /* Uncontainable */ #define ERROR_STATUS_UET_UEU 0x1 /* Unrecoverable */ -#define ERROR_STATUS_UET_UEO 0x2 /* Restable */ +#define ERROR_STATUS_UET_UEO 0x2 /* Restartable */ #define ERROR_STATUS_UET_UER 0x3 /* Recoverable */ /* Error types for Synchronous exceptions */ From daeae495117e8e1496a44392217230ced17b39be Mon Sep 17 00:00:00 2001 From: Vinoj Soundararajan Date: Thu, 1 Aug 2024 19:03:08 +0000 Subject: [PATCH 3/4] feat(ras): add asynchronous error type corrected Add asynchronous error type Corrected (CE) to error status AET based on PE error state recording in the exception syndrome Refer to https://developer.arm.com/documentation/ddi0487/latest/ RAS PE architecture. Change-Id: I9f2525411b94c8fd397b4a0b8cf5dc47457a2771 Signed-off-by: Vinoj Soundararajan --- include/lib/extensions/ras_arch.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/lib/extensions/ras_arch.h b/include/lib/extensions/ras_arch.h index 941ed71ea..b00ffeecd 100644 --- a/include/lib/extensions/ras_arch.h +++ b/include/lib/extensions/ras_arch.h @@ -146,6 +146,9 @@ #define ERROR_STATUS_UET_UEO 0x2 /* Restartable */ #define ERROR_STATUS_UET_UER 0x3 /* Recoverable */ +/* Corrected error types for Asynchronous exceptions */ +#define ERROR_STATUS_CET_CE 0x6 /* Corrected (CE) */ + /* Error types for Synchronous exceptions */ #define ERROR_STATUS_SET_UER 0x0 /* Recoverable */ #define ERROR_STATUS_SET_UC 0x2 /* Uncontainable */ From ec6f49c26be266e9d2b26818f35765ba9edd4e10 Mon Sep 17 00:00:00 2001 From: Vinoj Soundararajan Date: Thu, 1 Aug 2024 20:15:29 +0000 Subject: [PATCH 4/4] feat(ras): add eabort get helper function Add EABORT get field helper function to obtain SET, AET (UET) values from esr_el3/disr_el1 based on PE error state recording in the exception syndrome refer to RAS PE architecture in https://developer.arm.com/documentation/ddi0487/latest/ Change-Id: I0011f041a3089c9bbf670275687ad7c3362a07f9 Signed-off-by: Vinoj Soundararajan --- include/lib/extensions/ras_arch.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/lib/extensions/ras_arch.h b/include/lib/extensions/ras_arch.h index b00ffeecd..fb2d526e9 100644 --- a/include/lib/extensions/ras_arch.h +++ b/include/lib/extensions/ras_arch.h @@ -178,6 +178,9 @@ #define EABORT_SET_WIDTH U(2) #define EABORT_SET_MASK U(0x3) +#define EABORT_GET_FIELD(_esr_el3, _field) \ + (((_esr_el3) >> EABORT_ ##_field ##_SHIFT) & EABORT_ ##_field ##_MASK) + /* DFSC code for SErrors */ #define DFSC_SERROR 0x11