From: Hanjun Guo <guohanjun@huawei.com>
To: Breno Leitao <leitao@debian.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, James Morse <james.morse@arm.com>,
Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
Robert Moore <robert.moore@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>, <x86@kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
Oliver O'Halloran <oohall@gmail.com>,
Bjorn Helgaas <bhelgaas@google.com>
Cc: <linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<acpica-devel@lists.linux.dev>, <osandov@osandov.com>,
<xueshuai@linux.alibaba.com>, <konrad.wilk@oracle.com>,
<linux-edac@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
<linux-pci@vger.kernel.org>, <kernel-team@meta.com>
Subject: Re: [PATCH RESEND v5] vmcoreinfo: Track and log recoverable hardware errors
Date: Fri, 21 Nov 2025 10:47:32 +0800 [thread overview]
Message-ID: <a4a34583-8f26-bb08-001f-a53715070c00@huawei.com> (raw)
In-Reply-To: <20251010-vmcore_hw_error-v5-1-636ede3efe44@debian.org>
On 2025/10/10 18:36, Breno Leitao wrote:
> Introduce a generic infrastructure for tracking recoverable hardware
> errors (HW errors that are visible to the OS but does not cause a panic)
> and record them for vmcore consumption. This aids post-mortem crash
> analysis tools by preserving a count and timestamp for the last
> occurrence of such errors. On the other side, correctable errors, which
> the OS typically remains unaware of because the underlying hardware
> handles them transparently, are less relevant for crash dump
> and therefore are NOT tracked in this infrastructure.
>
> Add centralized logging for sources of recoverable hardware
> errors based on the subsystem it has been notified.
>
> hwerror_data is write-only at kernel runtime, and it is meant to be read
> from vmcore using tools like crash/drgn. For example, this is how it
> looks like when opening the crashdump from drgn.
>
> >>> prog['hwerror_data']
> (struct hwerror_info[1]){
> {
> .count = (int)844,
> .timestamp = (time64_t)1752852018,
> },
> ...
>
> This helps fleet operators quickly triage whether a crash may be
> influenced by hardware recoverable errors (which executes a uncommon
> code path in the kernel), especially when recoverable errors occurred
> shortly before a panic, such as the bug fixed by
> commit ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them
> when destroying the pool")
>
> This is not intended to replace full hardware diagnostics but provides
> a fast way to correlate hardware events with kernel panics quickly.
>
> Rare machine check exceptions—like those indicated by mce_flags.p5 or
> mce_flags.winchip—are not accounted for in this method, as they fall
> outside the intended usage scope for this feature’s user base.
>
> Suggested-by: Tony Luck <tony.luck@intel.com>
> Suggested-by: Shuai Xue <xueshuai@linux.alibaba.com>
> Signed-off-by: Breno Leitao <leitao@debian.org>
> Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
> ---
> Changes in v5:
> - Move the headers to uapi file (Dave Hansen)
> - Use atomic operations in the tracking struct (Dave Hansen)
> - Drop the MCE enum type, and track MCE errors as "others"
> - Document this feature better
> - Link to v4: https://lore.kernel.org/r/20250801-vmcore_hw_error-v4-1-fa1fe65edb83@debian.org
>
> Changes in v4:
> - Split the error by hardware subsystem instead of kernel
> subsystem/driver (Shuai)
> - Do not count the corrected errors, only focusing on recoverable errors (Shuai)
> - Link to v3: https://lore.kernel.org/r/20250722-vmcore_hw_error-v3-1-ff0683fc1f17@debian.org
>
> Changes in v3:
> - Add more information about this feature in the commit message
> (Borislav Petkov)
> - Renamed the function to hwerr_log_error_type() and use hwerr as
> suffix (Borislav Petkov)
> - Make the empty function static inline (kernel test robot)
> - Link to v2: https://lore.kernel.org/r/20250721-vmcore_hw_error-v2-1-ab65a6b43c5a@debian.org
>
> Changes in v2:
> - Split the counter by recoverable error (Tony Luck)
> - Link to v1: https://lore.kernel.org/r/20250714-vmcore_hw_error-v1-1-8cf45edb6334@debian.org
> ---
> Documentation/driver-api/hw-recoverable-errors.rst | 60 ++++++++++++++++++++++
> arch/x86/kernel/cpu/mce/core.c | 4 ++
> drivers/acpi/apei/ghes.c | 36 +++++++++++++
For the APEI part,
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Thanks
Hanjun
prev parent reply other threads:[~2025-11-21 2:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 10:36 Breno Leitao
2025-11-18 13:01 ` Breno Leitao
2025-11-18 14:10 ` Borislav Petkov
2025-11-25 9:26 ` Breno Leitao
2025-11-25 17:32 ` Andrew Morton
2025-11-25 17:42 ` Borislav Petkov
2025-11-21 2:47 ` Hanjun Guo [this message]
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=a4a34583-8f26-bb08-001f-a53715070c00@huawei.com \
--to=guohanjun@huawei.com \
--cc=acpica-devel@lists.linux.dev \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=james.morse@arm.com \
--cc=kernel-team@meta.com \
--cc=konrad.wilk@oracle.com \
--cc=leitao@debian.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mahesh@linux.ibm.com \
--cc=mchehab@kernel.org \
--cc=mingo@redhat.com \
--cc=oohall@gmail.com \
--cc=osandov@osandov.com \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=xueshuai@linux.alibaba.com \
/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®