From patchwork Thu Mar 21 02:53:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruidong Tian X-Patchwork-Id: 13598340 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67A45C54E58 for ; Thu, 21 Mar 2024 02:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QnOTfn100YWY0dsNRXB76lMr5aZWh3ZQI1gzQoaw5lk=; b=P3ZHRe2/Y8WkRP Xwg2+kPYgwiQkawVOOV9IocNPqOP/PXmaUuvfS3SaG7C98JSsGhhAlO1eY5CYQBRxUMJH59pxsT8g uhWSnz8xxx8ipRVMJ23/D0cRTAP3zdpsbf57bh8yQIpZrnI2vDbYLCxml16MtAiee5YlLcV3F+J/c PJqOp08IJYVE2HYv2wySxXP3l7vITbZuTGrvpqw3W0Snlq59aUIhyxvihwrYzzis3bmXxKgPMIr7j XffpKMW3FHfH7zODPHr/BzNPRMCPr9EAGu/rgUJAku6RHoqdrCge1hPvcWEPlejzoa3cP+FPvU3x0 5jdw0nOuykxUbcw5IDQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rn8Yl-00000001dEj-3zm1; Thu, 21 Mar 2024 02:53:39 +0000 Received: from out30-111.freemail.mail.aliyun.com ([115.124.30.111]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rn8Ye-00000001dBX-0eUx for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2024 02:53:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1710989609; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=anz3MwjVTqaEAr814YVWwtLwOjciPBCCWi+hggJe6sk=; b=hHX8oD6cQj0/gIZsJat753lg5Zpyew3DBJ5sni2dZBPuYZISiNEoVyqQgqhMCrSu/5SNMiTXM4WAzj4t2PWAsUR+hov0ZQy/fnNS9o0IIo3p4k0w0DS8Q90wvmYpffpg4sepU6ydF63G4x0eT5fuexmHfI8kYSYq84nULKPT6/A= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=tianruidong@linux.alibaba.com;NM=1;PH=DS;RN=18;SR=0;TI=SMTPD_---0W2zEwDe_1710989607; Received: from localhost(mailfrom:tianruidong@linux.alibaba.com fp:SMTPD_---0W2zEwDe_1710989607) by smtp.aliyun-inc.com; Thu, 21 Mar 2024 10:53:28 +0800 From: Ruidong Tian To: catalin.marinas@arm.com, will@kernel.org, lpieralisi@kernel.org, guohanjun@huawei.com, sudeep.holla@arm.com, xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, rafael@kernel.org, lenb@kernel.org, tony.luck@intel.com, bp@alien8.de, linux-edac@vger.kernel.org Cc: tianruidond@linux.alibaba.com, Tyler Baicar , Ruidong Tian Subject: [PATCH v2 2/2] trace, ras: add ARM RAS extension trace event Date: Thu, 21 Mar 2024 10:53:17 +0800 Message-Id: <20240321025317.114621-3-tianruidong@linux.alibaba.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20240321025317.114621-1-tianruidong@linux.alibaba.com> References: <20240321025317.114621-1-tianruidong@linux.alibaba.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240320_195332_407797_208287F8 X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Tyler Baicar Add a trace event for hardware errors reported by the ARMv8 RAS extension registers. Signed-off-by: Tyler Baicar Signed-off-by: Ruidong Tian --- drivers/acpi/arm64/aest.c | 5 ++++ include/ras/ras_event.h | 55 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/drivers/acpi/arm64/aest.c b/drivers/acpi/arm64/aest.c index ab17aa5f5997..0cfe7fb9d4b9 100644 --- a/drivers/acpi/arm64/aest.c +++ b/drivers/acpi/arm64/aest.c @@ -15,6 +15,8 @@ #include #include +#include + #undef pr_fmt #define pr_fmt(fmt) "ACPI AEST: " fmt @@ -153,6 +155,9 @@ static void aest_print(struct aest_node_llist *lnode) pr_err("%s ERR%uMISC2: 0x%llx\n", pfx_seq, index, regs->err_misc[2]); pr_err("%s ERR%uMISC3: 0x%llx\n", pfx_seq, index, regs->err_misc[3]); } + + trace_arm_ras_ext_event(lnode->type, lnode->id0, lnode->id1, index, + lnode->regs); } static void aest_handle_memory_failure(struct aest_node_llist *lnode) diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h index cbd3ddd7c33d..6003cab65ae4 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 +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_misc[0]; + __entry->err_misc1 = regs->err_misc[1]; + __entry->err_misc2 = regs->err_misc[2]; + __entry->err_misc3 = regs->err_misc[3]; + ), + + 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 *