Skip to contentSkip to conversation

RAS: Report ARM processor information to userspace

PATCH RESEND In review Daniel Ferguson 2 participants 4 messages Dec 14, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover RAS: Report ARM processor information to userspace

The original patch remain unmodified. This is merely a resubmission of the patch to get it moving forward again.

Links:
https://lore.kernel.org/lkml/[email protected]/T/

Shengwei Luo (1):
RAS: Report ARM processor information to userspace

 drivers/acpi/apei/ghes.c |  3 +--
 drivers/ras/ras.c        | 46 ++++++++++++++++++++++++++++++++++++--
 include/linux/ras.h      | 15 +++++++++++--
 include/ras/ras_event.h  | 48 +++++++++++++++++++++++++++++++++++-----
 4 files changed, 101 insertions(+), 11 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH RESEND v3 1/1 RAS: Report ARM processor information to userspace

From: Shengwei Luo <[email protected]>

The original arm_event trace code only traces out ARM processor error information data. It's not enough for user to take appropriate action.

According to UEFI_2_9 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. In addition to these info, there are error severity and cpu logical index about the event. Report all of these information to userspace via perf i/f. So that the user can do cpu core isolation according to error severity and other info.

---
 drivers/acpi/apei/ghes.c |  3 +--
 drivers/ras/ras.c        | 46 ++++++++++++++++++++++++++++++++++++--
 include/linux/ras.h      | 15 +++++++++++--
 include/ras/ras_event.h  | 48 +++++++++++++++++++++++++++++++++++-----
 4 files changed, 101 insertions(+), 11 deletions(-)
drivers/acpi/apei/ghes.c +1 -2
index ef59d6ea16da..98c2bfffbabb 100644
@@ -504,9 +504,8 @@ static bool ghes_handle_arm_hw_error(struct acpi_hest_generic_data *gdata, int s
 	int sec_sev, i;
 	char *p;
 
-	log_arm_hw_error(err);
-
 	sec_sev = ghes_severity(gdata->error_severity);
+	log_arm_hw_error(err, sec_sev);
 	if (sev != GHES_SEV_RECOVERABLE || sec_sev != GHES_SEV_RECOVERABLE)
 		return false;
 
drivers/ras/ras.c +44 -2

53 lines not on this page · raw message

include/linux/ras.h +13 -2
index 1f4048bf2674..4529775374d0 100644
@@ -24,7 +24,7 @@ int __init parse_cec_param(char *str);
 void log_non_standard_event(const guid_t *sec_type,
 			    const guid_t *fru_id, const char *fru_text,
 			    const u8 sev, const u8 *err, const u32 len);
-void log_arm_hw_error(struct cper_sec_proc_arm *err);
+void log_arm_hw_error(struct cper_sec_proc_arm *err, const u8 sev);
 #else
 static inline void
 log_non_standard_event(const guid_t *sec_type,
@@ -32,7 +32,18 @@ log_non_standard_event(const guid_t *sec_type,
 		       const u8 sev, const u8 *err, const u32 len)
 { return; }
 static inline void
-log_arm_hw_error(struct cper_sec_proc_arm *err) { return; }
+log_arm_hw_error(struct cper_sec_proc_arm *err, const u8 sev) { return; }
 #endif
 
+#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
+#include <asm/smp_plat.h>
+/*
+ * Include ARM specific SMP header which provides a function mapping mpidr to
+ * cpu logical index.
+ */
+#define GET_LOGICAL_INDEX(mpidr) get_logical_index(mpidr & MPIDR_HWID_BITMASK)
+#else
+#define GET_LOGICAL_INDEX(mpidr) -EINVAL
+#endif /* CONFIG_ARM || CONFIG_ARM64 */
+
 #endif /* __RAS_H__ */
include/ras/ras_event.h +43 -5

72 lines not on this page · raw message

Signature · 1 line
2.43.0
maintainer
#2 lore raw
Quoted 11 lines
 drivers/acpi/apei/ghes.c |  3 +--
 drivers/ras/ras.c        | 46 ++++++++++++++++++++++++++++++++++++--
 include/linux/ras.h      | 15 +++++++++++--
 include/ras/ras_event.h  | 48 +++++++++++++++++++++++++++++++++++-----
 4 files changed, 101 insertions(+), 11 deletions(-)
drivers/ras/ras.c +0 -0
index 95540ea8dd9d..2a7f424d59b9 100644

drivers/ras/ras.c void log_non_standard_event(const guid_t *sec_type, const guid_t *fru_id, · line 25

Quoted 6 lines
drivers/ras/ras.c +1 -1
@@ -21,9 +21,51 @@ void log_non_standard_event(const guid_t *sec_type, const guid_t *fru_id,
      trace_non_standard_event(sec_type, fru_id, fru_text, sev, err, len);
 }
 
-void log_arm_hw_error(struct cper_sec_proc_arm *err)
+void log_arm_hw_error(struct cper_sec_proc_arm *err, const u8 sev)
 {

What GIT tree is this patch based on? I don't see this log_arm_hw_error() function in drivers/ras/ras.c upstream, or in intel-next.

Should ARM specific code like this be in a file with "arm" in its name? Or at least be inside some #ifdef CONFIG_ARM.

-Tony

maintainer
#3 lore raw
Quoted 2 lines

What GIT tree is this patch based on? I don't see this log_arm_hw_error() function in drivers/ras/ras.c upstream, or in intel-next.

Thirty seconds after hitting SEND, I see I was looking at the wrong GIT tree. This code is based on upstream. Ooops.

Quoted 2 lines

Should ARM specific code like this be in a file with "arm" in its name? Or at least be inside some #ifdef CONFIG_ARM.

But I stand by this part.

-Tony