Skip to contentSkip to conversation

arm64/ras: Update code to trace out more data for ARM processor

PATCH Superseded Jason Tian 1 participant 1 message Jan 4, 2021 RAS infrastructure

lore
Share & tools
lore

Jason Tian

author
#0 lore raw

PATCH v2 1/1 arm64/ras: Update code to trace out more data for ARM processor

The original arm_event trace code only traces out ARM processor error information data. According to UEFI_2_8_A_Feb14 specification chapter N2.4.4, the ARM processor error section includes several ARM processor error information, several ARM processor context information and several vendor specific error information structures.

Add code to trace out all ARM processor context information and vendor specific error information with raw hex format.

---
 drivers/ras/ras.c       | 22 +++++++++++++++++++++-
 include/ras/ras_event.h | 41 +++++++++++++++++++++++++++++++++++------
 2 files changed, 56 insertions(+), 7 deletions(-)
drivers/ras/ras.c +21 -1
index 3f3890732..a0a6b2f87 100644
@@ -23,7 +23,27 @@ void log_non_standard_event(const uuid_le *sec_type, const uuid_le *fru_id,
 
 void log_arm_hw_error(struct cper_sec_proc_arm *err)
 {
-	trace_arm_event(err);
+	u32 pei_len;
+	u32 ctx_len;
+	u32 vsei_len;
+	u8 *pei_err;
+	u8 *ctx_err;
+	u8 *ven_err_data;
+
+	pei_len = sizeof(struct cper_arm_err_info) * err->err_info_num;
+	pei_err = (u8 *) err + sizeof(struct cper_sec_proc_arm);
+
+	ctx_len = sizeof(struct cper_arm_ctx_info) * err->context_info_num;
+	ctx_err = pei_err + sizeof(struct cper_arm_err_info) *
+		err->err_info_num;
+
+	vsei_len = err->section_length - (sizeof(struct cper_sec_proc_arm) +
+					  pei_len + ctx_len);
+	ven_err_data = ctx_err + sizeof(struct cper_arm_ctx_info) *
+					  err->context_info_num;
+
+	trace_arm_event(err, pei_err, pei_len, ctx_err, ctx_len,
+			ven_err_data, vsei_len);
 }
 
 static int __init ras_init(void)
include/ras/ras_event.h +35 -6

64 lines not on this page · raw message

Signature · 1 line
2.25.1