@@ -11,6 +11,8 @@
#include "init.h"
+#include <ras/ras_event.h>
+
#undef pr_fmt
#define pr_fmt(fmt) "ACPI AEST: " fmt
@@ -13,6 +13,8 @@
#include <linux/genalloc.h>
#include <linux/ras.h>
+#include <ras/ras_event.h>
+
#include "aest.h"
DEFINE_PER_CPU(struct aest_device, percpu_adev);
@@ -90,6 +92,10 @@ static void aest_print(struct aest_event *event)
pr_err("%s ERR%dMISC3: 0x%llx\n", pfx_seq, index,
regs->err_misc[3]);
}
+
+ trace_arm_ras_ext_event(event->type, event->id0, event->id1,
+ event->index, event->hid, &event->regs,
+ event->vendor_data, event->vendor_data_size);
}
static void aest_handle_memory_failure(u64 addr)
@@ -72,6 +72,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(extlog_mem_event);
EXPORT_TRACEPOINT_SYMBOL_GPL(mc_event);
EXPORT_TRACEPOINT_SYMBOL_GPL(non_standard_event);
EXPORT_TRACEPOINT_SYMBOL_GPL(arm_event);
+#ifdef CONFIG_ARM64_RAS_EXTN
+EXPORT_TRACEPOINT_SYMBOL_GPL(arm_ras_ext_event);
+#endif
static int __init parse_ras_param(char *str)
{
@@ -338,6 +338,77 @@ 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(const u8 type,
+ const u32 id0,
+ const u32 id1,
+ const u32 index,
+ char *hid,
+ struct ras_ext_regs *regs,
+ const u8 *data,
+ const u32 len),
+
+ TP_ARGS(type, id0, id1, index, hid, regs, data, len),
+
+ TP_STRUCT__entry(
+ __field(u8, type)
+ __field(u32, id0)
+ __field(u32, id1)
+ __field(u32, index)
+ __field(char *, hid)
+ __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)
+ __field(u32, len)
+ __dynamic_array(u8, buf, len)
+ ),
+
+ TP_fast_assign(
+ __entry->type = type;
+ __entry->id0 = id0;
+ __entry->id1 = id1;
+ __entry->index = index;
+ __entry->hid = hid;
+ __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_misc[0];
+ __entry->err_misc1 = regs->err_misc[1];
+ __entry->err_misc2 = regs->err_misc[2];
+ __entry->err_misc3 = regs->err_misc[3];
+ __entry->len = len;
+ memcpy(__get_dynamic_array(buf), data, len);
+ ),
+
+ TP_printk("type: %d; id0: %d; id1: %d; index: %d; hid: %s; "
+ "ERR_FR: %llx; ERR_CTLR: %llx; ERR_STATUS: %llx; "
+ "ERR_ADDR: %llx; ERR_MISC0: %llx; ERR_MISC1: %llx; "
+ "ERR_MISC2: %llx; ERR_MISC3: %llx; data len:%d; raw data:%s",
+ __entry->type, __entry->id0, __entry->id1, __entry->index,
+ __entry->hid, __entry->err_fr, __entry->err_ctlr,
+ __entry->err_status, __entry->err_addr, __entry->err_misc0,
+ __entry->err_misc1, __entry->err_misc2, __entry->err_misc3,
+ __entry->len,
+ __print_hex(__get_dynamic_array(buf), __entry->len))
+);
+#endif
+
/*
* memory-failure recovery action result event
*