[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211124170708.3874-3-baicar@os.amperecomputing.com>
Date: Wed, 24 Nov 2021 12:07:08 -0500
From: Tyler Baicar <baicar@...amperecomputing.com>
To: patches@...erecomputing.com, abdulhamid@...amperecomputing.com,
darren@...amperecomputing.com, catalin.marinas@....com,
will@...nel.org, maz@...nel.org, james.morse@....com,
alexandru.elisei@....com, suzuki.poulose@....com,
lorenzo.pieralisi@....com, guohanjun@...wei.com,
sudeep.holla@....com, rafael@...nel.org, lenb@...nel.org,
tony.luck@...el.com, bp@...en8.de, mark.rutland@....com,
anshuman.khandual@....com, vincenzo.frascino@....com,
tabba@...gle.com, marcan@...can.st, keescook@...omium.org,
jthierry@...hat.com, masahiroy@...nel.org, samitolvanen@...gle.com,
john.garry@...wei.com, daniel.lezcano@...aro.org,
gor@...ux.ibm.com, zhangshaokun@...ilicon.com,
tmricht@...ux.ibm.com, dchinner@...hat.com, tglx@...utronix.de,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
kvmarm@...ts.cs.columbia.edu, linux-acpi@...r.kernel.org,
linux-edac@...r.kernel.org, ishii.shuuichir@...itsu.com,
Vineeth.Pillai@...rosoft.com
Cc: Tyler Baicar <baicar@...amperecomputing.com>
Subject: [PATCH 2/2] trace, ras: add ARM RAS extension trace event
Add a trace event for hardware errors reported by the ARMv8
RAS extension registers.
Signed-off-by: Tyler Baicar <baicar@...amperecomputing.com>
---
arch/arm64/kernel/ras.c | 4 +++
drivers/acpi/arm64/aest.c | 5 ++++
include/ras/ras_event.h | 55 +++++++++++++++++++++++++++++++++++++++
3 files changed, 64 insertions(+)
diff --git a/arch/arm64/kernel/ras.c b/arch/arm64/kernel/ras.c
index 31e2036a4c70..18071790b2a3 100644
--- a/arch/arm64/kernel/ras.c
+++ b/arch/arm64/kernel/ras.c
@@ -6,6 +6,8 @@
#include <asm/cpufeature.h>
#include <asm/ras.h>
+#include <ras/ras_event.h>
+
static bool ras_extn_v1p1(void)
{
unsigned long fld, reg = read_sanitised_ftr_reg(SYS_ID_AA64PFR0_EL1);
@@ -95,6 +97,8 @@ void arch_arm_ras_report_error(u64 implemented, bool clear_misc)
arch_arm_ras_print_error(®s, i, misc23_present);
+ trace_arm_ras_ext_event(0, cpu_num, 0, i, ®s);
+
/*
* In the future, we will treat UER conditions as potentially
* recoverable.
diff --git a/drivers/acpi/arm64/aest.c b/drivers/acpi/arm64/aest.c
index 2df4f2377e51..7ef1750f91b3 100644
--- a/drivers/acpi/arm64/aest.c
+++ b/drivers/acpi/arm64/aest.c
@@ -14,6 +14,8 @@
#include <asm/ras.h>
+#include <ras/ras_event.h>
+
#undef pr_fmt
#define pr_fmt(fmt) "ACPI AEST: " fmt
@@ -126,6 +128,9 @@ static void aest_proc(struct aest_node_data *data)
aest_print(data, regs, i, misc23_present);
+ trace_arm_ras_ext_event(data->node_type, data->data.vendor.acpi_hid,
+ data->data.vendor.acpi_uid, i, ®s);
+
if (regs.err_status & ERR_STATUS_UE)
fatal = true;
diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h
index 0bdbc0d17d2f..27b2be9f950d 100644
--- a/include/ras/ras_event.h
+++ b/include/ras/ras_event.h
@@ -338,6 +338,61 @@ TRACE_EVENT(aer_event,
"Not available")
);
+/*
+ * ARM RAS Extension Events Report
+ *
+ * This event is generated when an error reported by the ARM RAS extension
+ * hardware is detected.
+ */
+
+#ifdef CONFIG_ARM64_RAS_EXTN
+#include <asm/ras.h>
+TRACE_EVENT(arm_ras_ext_event,
+
+ TP_PROTO(u8 type, u32 id0, u32 id1, u32 index, struct ras_ext_regs *regs),
+
+ TP_ARGS(type, id0, id1, index, regs),
+
+ TP_STRUCT__entry(
+ __field(u8, type)
+ __field(u32, id0)
+ __field(u32, id1)
+ __field(u32, index)
+ __field(u64, err_fr)
+ __field(u64, err_ctlr)
+ __field(u64, err_status)
+ __field(u64, err_addr)
+ __field(u64, err_misc0)
+ __field(u64, err_misc1)
+ __field(u64, err_misc2)
+ __field(u64, err_misc3)
+ ),
+
+ TP_fast_assign(
+ __entry->type = type;
+ __entry->id0 = id0;
+ __entry->id1 = id1;
+ __entry->index = index;
+ __entry->err_fr = regs->err_fr;
+ __entry->err_ctlr = regs->err_ctlr;
+ __entry->err_status = regs->err_status;
+ __entry->err_addr = regs->err_addr;
+ __entry->err_misc0 = regs->err_misc0;
+ __entry->err_misc1 = regs->err_misc1;
+ __entry->err_misc2 = regs->err_misc2;
+ __entry->err_misc3 = regs->err_misc3;
+ ),
+
+ TP_printk("type: %d; id0: %d; id1: %d; index: %d; ERR_FR: %llx; ERR_CTLR: %llx; "
+ "ERR_STATUS: %llx; ERR_ADDR: %llx; ERR_MISC0: %llx; ERR_MISC1: %llx; "
+ "ERR_MISC2: %llx; ERR_MISC3: %llx",
+ __entry->type, __entry->id0, __entry->id1, __entry->index, __entry->err_fr,
+ __entry->err_ctlr, __entry->err_status, __entry->err_addr,
+ __entry->err_misc0, __entry->err_misc1, __entry->err_misc2,
+ __entry->err_misc3)
+);
+#endif
+
/*
* memory-failure recovery action result event
*
--
2.33.1
Powered by blists - more mailing lists