mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr()
@ 2026-10-30 12:18 Breno Leitao
  2026-11-04  1:16 ` Shuai Xue
  0 siblings, 1 reply; 2+ messages in thread
From: Breno Leitao @ 2026-10-30 12:18 UTC (permalink / raw)
  To: Rafael J. Wysocki, Tony Luck, Borislav Petkov, Hanjun Guo,
	Mauro Carvalho Chehab, Shuai Xue, Len Brown, Andrew Morton
  Cc: linux-acpi, linux-kernel, kernel-team, stable, Breno Leitao

ghes_log_hwerr() is meant to count recoverable GHES errors in
hwerror_data[], but it skips them and counts informational records
instead. As a result, recoverable CPU, memory, CXL and vendor-specific
errors reported through GHES never show up in a vmcore.

ghes_do_proc() passes ghes_log_hwerr() the record severity after
ghes_severity() has converted it to a GHES_SEV_* value.
ghes_log_hwerr() compares it against CPER_SEV_RECOVERABLE, which is 0
in the CPER enum and matches GHES_SEV_NO, so only informational records
pass and GHES_SEV_RECOVERABLE ones return early.

Compare against GHES_SEV_RECOVERABLE instead.

Recoverable PCIe errors that ghes_handle_aer() hands to AER are also
counted by pci_dev_aer_stats_incr(), so with the check fixed they are
counted twice under HWERR_RECOV_PCI. That is not addressed here.

Fixes: 3fa805c37dd4 ("vmcoreinfo: track and log recoverable hardware errors")
Cc: stable@vger.kernel.org
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 drivers/acpi/apei/ghes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 663dc2e601cf72..5d888c82efeaa3 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -899,7 +899,7 @@ EXPORT_SYMBOL_NS_GPL(cxl_cper_kfifo_get, "CXL");
 
 static void ghes_log_hwerr(int sev, guid_t *sec_type)
 {
-	if (sev != CPER_SEV_RECOVERABLE)
+	if (sev != GHES_SEV_RECOVERABLE)
 		return;
 
 	if (guid_equal(sec_type, &CPER_SEC_PROC_ARM) ||

---
base-commit: a39c950806213f6861d00f90729acaaa21f2d95a
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
change-id: 20261030-ghes-hwerr-sev-e440624108b6

Best regards,
--  
Breno Leitao <leitao@debian.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr()
  2026-10-30 12:18 [PATCH] ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr() Breno Leitao
@ 2026-11-04  1:16 ` Shuai Xue
  0 siblings, 0 replies; 2+ messages in thread
From: Shuai Xue @ 2026-11-04  1:16 UTC (permalink / raw)
  To: Breno Leitao, Rafael J. Wysocki, Tony Luck, Borislav Petkov,
	Hanjun Guo, Mauro Carvalho Chehab, Len Brown, Andrew Morton
  Cc: linux-acpi, linux-kernel, kernel-team, stable



On 10/30/26 8:18 PM, Breno Leitao wrote:
> ghes_log_hwerr() is meant to count recoverable GHES errors in
> hwerror_data[], but it skips them and counts informational records
> instead. As a result, recoverable CPU, memory, CXL and vendor-specific
> errors reported through GHES never show up in a vmcore.
> 
> ghes_do_proc() passes ghes_log_hwerr() the record severity after
> ghes_severity() has converted it to a GHES_SEV_* value.
> ghes_log_hwerr() compares it against CPER_SEV_RECOVERABLE, which is 0
> in the CPER enum and matches GHES_SEV_NO, so only informational records
> pass and GHES_SEV_RECOVERABLE ones return early.
> 
> Compare against GHES_SEV_RECOVERABLE instead.
> 
> Recoverable PCIe errors that ghes_handle_aer() hands to AER are also
> counted by pci_dev_aer_stats_incr(), so with the check fixed they are
> counted twice under HWERR_RECOV_PCI. That is not addressed here.
> 
> Fixes: 3fa805c37dd4 ("vmcoreinfo: track and log recoverable hardware errors")
> Cc: stable@vger.kernel.org
> Signed-off-by: Breno Leitao <leitao@debian.org>
> ---
>   drivers/acpi/apei/ghes.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index 663dc2e601cf72..5d888c82efeaa3 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -899,7 +899,7 @@ EXPORT_SYMBOL_NS_GPL(cxl_cper_kfifo_get, "CXL");
>   
>   static void ghes_log_hwerr(int sev, guid_t *sec_type)
>   {
> -	if (sev != CPER_SEV_RECOVERABLE)
> +	if (sev != GHES_SEV_RECOVERABLE)
>   		return;
>   
>   	if (guid_equal(sec_type, &CPER_SEC_PROC_ARM) ||
> 
> ---
> base-commit: a39c950806213f6861d00f90729acaaa21f2d95a
> base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> change-id: 20261030-ghes-hwerr-sev-e440624108b6
> 
> Best regards,
> --
> Breno Leitao <leitao@debian.org>


LGTM.

Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>

Thanks.
Shuai


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-04  1:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-30 12:18 [PATCH] ACPI: APEI: GHES: Fix severity check in ghes_log_hwerr() Breno Leitao
2026-11-04  1:16 ` Shuai Xue

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®