From: Shuai Xue <xueshuai@linux.alibaba.com>
To: keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com,
rafael@kernel.org, lenb@kernel.org, james.morse@arm.com,
bp@alien8.de, tglx@linutronix.de, mingo@redhat.com,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
ardb@kernel.org, robert.moore@intel.com
Cc: linux-hardening@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org,
linux-efi@vger.kernel.org,
acpica-devel@lists.linuxfoundation.org,
xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com
Subject: [RFC PATCH v2 3/9] ACPI: APEI: ERST: Emit the mce_record tracepoint
Date: Mon, 25 Sep 2023 15:44:20 +0800 [thread overview]
Message-ID: <20230925074426.97856-4-xueshuai@linux.alibaba.com> (raw)
In-Reply-To: <20230925074426.97856-1-xueshuai@linux.alibaba.com>
After /dev/mcelog character device deprecated by commit 5de97c9f6d85
("x86/mce: Factor out and deprecate the /dev/mcelog driver"), the
serialized hardware error log, a.k.a MCE record, of previous boot in
persistent storage is not collected via APEI ERST.
Emit the mce_record tracepoint so that it can consumed by the new
generation rasdaemon.
Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com>
---
drivers/acpi/apei/erst.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index 528ac5eb4871..82f57aaf89ad 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -26,6 +26,10 @@
#include <linux/vmalloc.h>
#include <linux/mm.h> /* kvfree() */
#include <acpi/apei.h>
+#ifdef CONFIG_X86_MCE
+/* only define CREATE_TRACE_POINTS once */
+#include <trace/events/mce.h>
+#endif
#include "apei-internal.h"
@@ -1063,8 +1067,12 @@ static ssize_t erst_reader(struct pstore_record *record)
record->compressed = true;
} else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG))
record->type = PSTORE_TYPE_DMESG;
- else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_MCE))
+ else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_MCE)) {
+#ifdef CONFIG_X86_MCE
+ trace_mce_record((struct mce *)rcd->data);
+#endif
record->type = PSTORE_TYPE_MCE;
+ }
else
record->type = PSTORE_TYPE_MAX;
--
2.41.0
next prev parent reply other threads:[~2023-09-25 7:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 7:44 [RFC PATCH v2 0/9] Use ERST for persistent storage of MCE and APEI errors Shuai Xue
2023-09-25 7:44 ` [RFC PATCH v2 1/9] pstore: move pstore creator id, section type and record struct to common header Shuai Xue
2023-09-25 17:13 ` Kees Cook
2023-09-26 6:47 ` Shuai Xue
2023-09-25 7:44 ` [RFC PATCH v2 2/9] ACPI: APEI: Use common ERST struct to read/write serialized MCE record Shuai Xue
2023-09-25 7:44 ` Shuai Xue [this message]
2023-09-25 7:44 ` [RFC PATCH v2 4/9] ACPI: tables: change section_type of generic error data as guid_t Shuai Xue
2023-09-25 7:44 ` [RFC PATCH v2 5/9] ACPI: APEI: GHES: Use ERST to serialize APEI generic error before panic Shuai Xue
2023-09-25 7:44 ` [RFC PATCH v2 6/9] ACPI: APEI: GHES: export ghes_report_chain Shuai Xue
2023-09-25 7:44 ` [RFC PATCH v2 7/9] ACPI: APEI: ESRT: kick ghes_report_chain notifier to report serialized memory errors Shuai Xue
2023-09-25 7:44 ` [RFC PATCH v2 8/9] ACPI: APEI: ESRT: print AER to report serialized PCIe errors Shuai Xue
2023-09-25 7:44 ` [RFC PATCH v2 9/9] ACPI: APEI: ESRT: log ARM processor error Shuai Xue
2023-09-28 14:43 ` [RFC PATCH v2 0/9] Use ERST for persistent storage of MCE and APEI errors Borislav Petkov
2023-10-07 7:15 ` Shuai Xue
2023-10-26 10:21 ` Shuai Xue
2023-10-26 13:32 ` Borislav Petkov
2024-11-26 7:04 ` Shuai Xue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230925074426.97856-4-xueshuai@linux.alibaba.com \
--to=xueshuai@linux.alibaba.com \
--cc=acpica-devel@lists.linuxfoundation.org \
--cc=ardb@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=gpiccoli@igalia.com \
--cc=hpa@zytor.com \
--cc=james.morse@arm.com \
--cc=keescook@chromium.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®