mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Len Brown <lenb@kernel.org>, James Morse <james.morse@arm.com>,
	 Jonathan Corbet <corbet@lwn.net>,
	tony.luck@intel.com, rafael@kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
	kbusch@kernel.org, rmikey@meta.com,  kuba@kernel.org,
	ast@kernel.org, linux-edac@vger.kernel.org,  mchehab@kernel.org,
	bp@alien8.de, linux-acpi@vger.kernel.org,
	 linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	 kernel-team@meta.com, Breno Leitao <leitao@debian.org>
Subject: [PATCH 2/2] acpi/ghes: taint kernel on recovered hardware errors
Date: Fri, 04 Jul 2025 03:55:20 -0700	[thread overview]
Message-ID: <20250704-taint_recovered-v1-2-7a817f2d228e@debian.org> (raw)
In-Reply-To: <20250704-taint_recovered-v1-0-7a817f2d228e@debian.org>

Update the GHES error processing logic to taint the kernel when
a recoverable or corrected hardware error is detected.

If the error severity is GHES_SEV_RECOVERABLE or GHES_SEV_CORRECTED, the
TAINT_HW_ERROR_RECOVERED flag is set. This allows users and support
tools to identify systems that have experienced hardware issues that
were recovered at runtime, improving traceability and diagnostics.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 drivers/acpi/apei/ghes.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 3d44f926afe8e..f323cefe234b9 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -1102,13 +1102,16 @@ static int ghes_proc(struct ghes *ghes)
 {
 	struct acpi_hest_generic_status *estatus = ghes->estatus;
 	u64 buf_paddr;
-	int rc;
+	int rc, sev;
 
 	rc = ghes_read_estatus(ghes, estatus, &buf_paddr, FIX_APEI_GHES_IRQ);
 	if (rc)
 		goto out;
 
-	if (ghes_severity(estatus->error_severity) >= GHES_SEV_PANIC)
+	sev = ghes_severity(estatus->error_severity);
+	if (sev == GHES_SEV_RECOVERABLE || sev ==  GHES_SEV_CORRECTED)
+		add_taint(TAINT_HW_ERROR_RECOVERED, LOCKDEP_STILL_OK);
+	else if (sev >= GHES_SEV_PANIC)
 		__ghes_panic(ghes, estatus, buf_paddr, FIX_APEI_GHES_IRQ);
 
 	if (!ghes_estatus_cached(estatus)) {

-- 
2.47.1


  parent reply	other threads:[~2025-07-04 10:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04 10:55 [PATCH 0/2] panic: taint flag for recoverable " Breno Leitao
2025-07-04 10:55 ` [PATCH 1/2] panic: add " Breno Leitao
2025-07-04 10:55 ` Breno Leitao [this message]
2025-07-04 11:19 ` [PATCH 0/2] panic: " Borislav Petkov
2025-07-04 12:15   ` Breno Leitao
2025-07-04 13:25     ` Borislav Petkov
2025-07-14 17:01       ` Breno Leitao

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=20250704-taint_recovered-v1-2-7a817f2d228e@debian.org \
    --to=leitao@debian.org \
    --cc=ast@kernel.org \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=james.morse@arm.com \
    --cc=kbusch@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rmikey@meta.com \
    --cc=tony.luck@intel.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®