* [PATCH] ACPI: extlog: Report error severity using GHES bindings in MCE
@ 2026-11-30 17:21 Pierre Gondois
2026-11-30 17:22 ` Pierre Gondois
2026-11-30 19:28 ` Jonathan Cameron
0 siblings, 2 replies; 3+ messages in thread
From: Pierre Gondois @ 2026-11-30 17:21 UTC (permalink / raw)
To: linux-kernel
Cc: Pierre Gondois, Rafael J. Wysocki, Len Brown, Tony Luck,
Borislav Petkov, Hanjun Guo, Mauro Carvalho Chehab, Shuai Xue,
Maciej Wieczor-Retman, Pawel Chmielewski, Dave Jiang,
Jonathan Cameron, Breno Leitao, Fabio M. De Francesco,
Terry Bowman, Dan Williams, Kuppuswamy Sathyanarayanan,
linux-acpi, acpica-devel
MCE extended logs report raw CPER severity values to
log_non_standard_event(). GHES relies on the GHES bindings in
ghes_do_proc(). The rasdaemon interprets the severity
as a GHES_SEV_* value.
Translate the CPER severity with ghes_severity() before reporting
the event.
Fixes: a2995f7dab51 ("ACPI: extlog: Trace CPER Non-standard Section Body")
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
drivers/acpi/acpi_extlog.c | 2 +-
drivers/acpi/apei/ghes.c | 17 -----------------
include/acpi/ghes.h | 17 +++++++++++++++++
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
index bf5f7b1a9aea..45efc10b51fb 100644
--- a/drivers/acpi/acpi_extlog.c
+++ b/drivers/acpi/acpi_extlog.c
@@ -247,7 +247,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
void *err = acpi_hest_get_payload(gdata);
log_non_standard_event(sec_type, fru_id, fru_text,
- gdata->error_severity, err,
+ ghes_severity(gdata->error_severity), err,
gdata->error_data_length);
}
}
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 5d888c82efea..1d98368d9f78 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -321,23 +321,6 @@ static void ghes_fini(struct ghes *ghes)
unmap_gen_v2(ghes);
}
-static inline int ghes_severity(int severity)
-{
- switch (severity) {
- case CPER_SEV_INFORMATIONAL:
- return GHES_SEV_NO;
- case CPER_SEV_CORRECTED:
- return GHES_SEV_CORRECTED;
- case CPER_SEV_RECOVERABLE:
- return GHES_SEV_RECOVERABLE;
- case CPER_SEV_FATAL:
- return GHES_SEV_PANIC;
- default:
- /* Unknown, go panic */
- return GHES_SEV_PANIC;
- }
-}
-
static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len,
int from_phys,
enum fixed_addresses fixmap_idx)
diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
index 7acf209061ea..dec7eaf9f651 100644
--- a/include/acpi/ghes.h
+++ b/include/acpi/ghes.h
@@ -54,6 +54,23 @@ enum {
GHES_SEV_PANIC = 0x3,
};
+static inline int ghes_severity(int severity)
+{
+ switch (severity) {
+ case CPER_SEV_INFORMATIONAL:
+ return GHES_SEV_NO;
+ case CPER_SEV_CORRECTED:
+ return GHES_SEV_CORRECTED;
+ case CPER_SEV_RECOVERABLE:
+ return GHES_SEV_RECOVERABLE;
+ case CPER_SEV_FATAL:
+ return GHES_SEV_PANIC;
+ default:
+ /* Unknown, go panic */
+ return GHES_SEV_PANIC;
+ }
+}
+
#ifdef CONFIG_ACPI_APEI_GHES
/**
* ghes_register_vendor_record_notifier - register a notifier for vendor
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] ACPI: extlog: Report error severity using GHES bindings in MCE
2026-11-30 17:21 [PATCH] ACPI: extlog: Report error severity using GHES bindings in MCE Pierre Gondois
@ 2026-11-30 17:22 ` Pierre Gondois
2026-11-30 19:28 ` Jonathan Cameron
1 sibling, 0 replies; 3+ messages in thread
From: Pierre Gondois @ 2026-11-30 17:22 UTC (permalink / raw)
To: linux-kernel
Cc: Rafael J. Wysocki, Len Brown, Tony Luck, Borislav Petkov,
Hanjun Guo, Mauro Carvalho Chehab, Shuai Xue,
Maciej Wieczor-Retman, Pawel Chmielewski, Dave Jiang,
Jonathan Cameron, Breno Leitao, Fabio M. De Francesco,
Terry Bowman, Dan Williams, Kuppuswamy Sathyanarayanan,
linux-acpi, acpica-devel
For reference, this patch was extracted from the serie at:
https://lore.kernel.org/all/20261117111444.4185512-17-pierre.gondois@arm.com/
On 11/30/26 18:21, Pierre Gondois wrote:
> MCE extended logs report raw CPER severity values to
> log_non_standard_event(). GHES relies on the GHES bindings in
> ghes_do_proc(). The rasdaemon interprets the severity
> as a GHES_SEV_* value.
>
> Translate the CPER severity with ghes_severity() before reporting
> the event.
>
> Fixes: a2995f7dab51 ("ACPI: extlog: Trace CPER Non-standard Section Body")
> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
> ---
> drivers/acpi/acpi_extlog.c | 2 +-
> drivers/acpi/apei/ghes.c | 17 -----------------
> include/acpi/ghes.h | 17 +++++++++++++++++
> 3 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
> index bf5f7b1a9aea..45efc10b51fb 100644
> --- a/drivers/acpi/acpi_extlog.c
> +++ b/drivers/acpi/acpi_extlog.c
> @@ -247,7 +247,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
> void *err = acpi_hest_get_payload(gdata);
>
> log_non_standard_event(sec_type, fru_id, fru_text,
> - gdata->error_severity, err,
> + ghes_severity(gdata->error_severity), err,
> gdata->error_data_length);
> }
> }
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index 5d888c82efea..1d98368d9f78 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -321,23 +321,6 @@ static void ghes_fini(struct ghes *ghes)
> unmap_gen_v2(ghes);
> }
>
> -static inline int ghes_severity(int severity)
> -{
> - switch (severity) {
> - case CPER_SEV_INFORMATIONAL:
> - return GHES_SEV_NO;
> - case CPER_SEV_CORRECTED:
> - return GHES_SEV_CORRECTED;
> - case CPER_SEV_RECOVERABLE:
> - return GHES_SEV_RECOVERABLE;
> - case CPER_SEV_FATAL:
> - return GHES_SEV_PANIC;
> - default:
> - /* Unknown, go panic */
> - return GHES_SEV_PANIC;
> - }
> -}
> -
> static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len,
> int from_phys,
> enum fixed_addresses fixmap_idx)
> diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
> index 7acf209061ea..dec7eaf9f651 100644
> --- a/include/acpi/ghes.h
> +++ b/include/acpi/ghes.h
> @@ -54,6 +54,23 @@ enum {
> GHES_SEV_PANIC = 0x3,
> };
>
> +static inline int ghes_severity(int severity)
> +{
> + switch (severity) {
> + case CPER_SEV_INFORMATIONAL:
> + return GHES_SEV_NO;
> + case CPER_SEV_CORRECTED:
> + return GHES_SEV_CORRECTED;
> + case CPER_SEV_RECOVERABLE:
> + return GHES_SEV_RECOVERABLE;
> + case CPER_SEV_FATAL:
> + return GHES_SEV_PANIC;
> + default:
> + /* Unknown, go panic */
> + return GHES_SEV_PANIC;
> + }
> +}
> +
> #ifdef CONFIG_ACPI_APEI_GHES
> /**
> * ghes_register_vendor_record_notifier - register a notifier for vendor
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ACPI: extlog: Report error severity using GHES bindings in MCE
2026-11-30 17:21 [PATCH] ACPI: extlog: Report error severity using GHES bindings in MCE Pierre Gondois
2026-11-30 17:22 ` Pierre Gondois
@ 2026-11-30 19:28 ` Jonathan Cameron
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2026-11-30 19:28 UTC (permalink / raw)
To: Pierre Gondois
Cc: linux-kernel, Rafael J. Wysocki, Len Brown, Tony Luck,
Borislav Petkov, Hanjun Guo, Mauro Carvalho Chehab, Shuai Xue,
Maciej Wieczor-Retman, Pawel Chmielewski, Dave Jiang,
Breno Leitao, Fabio M. De Francesco, Terry Bowman, Dan Williams,
Kuppuswamy Sathyanarayanan, linux-acpi, acpica-devel
On Mon, 30 Nov 2026 18:21:09 +0100
Pierre Gondois <pierre.gondois@arm.com> wrote:
> MCE extended logs report raw CPER severity values to
> log_non_standard_event(). GHES relies on the GHES bindings in
> ghes_do_proc(). The rasdaemon interprets the severity
> as a GHES_SEV_* value.
>
> Translate the CPER severity with ghes_severity() before reporting
> the event.
>
> Fixes: a2995f7dab51 ("ACPI: extlog: Trace CPER Non-standard Section Body")
> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
> ---
> drivers/acpi/acpi_extlog.c | 2 +-
> drivers/acpi/apei/ghes.c | 17 -----------------
> include/acpi/ghes.h | 17 +++++++++++++++++
> 3 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
> index bf5f7b1a9aea..45efc10b51fb 100644
> --- a/drivers/acpi/acpi_extlog.c
> +++ b/drivers/acpi/acpi_extlog.c
> @@ -247,7 +247,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
> void *err = acpi_hest_get_payload(gdata);
>
> log_non_standard_event(sec_type, fru_id, fru_text,
> - gdata->error_severity, err,
> + ghes_severity(gdata->error_severity), err,
> gdata->error_data_length);
> }
> }
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index 5d888c82efea..1d98368d9f78 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -321,23 +321,6 @@ static void ghes_fini(struct ghes *ghes)
> unmap_gen_v2(ghes);
> }
>
> -static inline int ghes_severity(int severity)
> -{
> - switch (severity) {
> - case CPER_SEV_INFORMATIONAL:
> - return GHES_SEV_NO;
> - case CPER_SEV_CORRECTED:
> - return GHES_SEV_CORRECTED;
> - case CPER_SEV_RECOVERABLE:
> - return GHES_SEV_RECOVERABLE;
> - case CPER_SEV_FATAL:
> - return GHES_SEV_PANIC;
> - default:
> - /* Unknown, go panic */
> - return GHES_SEV_PANIC;
> - }
> -}
> -
> static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len,
> int from_phys,
> enum fixed_addresses fixmap_idx)
> diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
> index 7acf209061ea..dec7eaf9f651 100644
> --- a/include/acpi/ghes.h
> +++ b/include/acpi/ghes.h
> @@ -54,6 +54,23 @@ enum {
> GHES_SEV_PANIC = 0x3,
> };
>
> +static inline int ghes_severity(int severity)
> +{
> + switch (severity) {
> + case CPER_SEV_INFORMATIONAL:
> + return GHES_SEV_NO;
> + case CPER_SEV_CORRECTED:
> + return GHES_SEV_CORRECTED;
> + case CPER_SEV_RECOVERABLE:
> + return GHES_SEV_RECOVERABLE;
> + case CPER_SEV_FATAL:
> + return GHES_SEV_PANIC;
> + default:
> + /* Unknown, go panic */
> + return GHES_SEV_PANIC;
> + }
> +}
> +
> #ifdef CONFIG_ACPI_APEI_GHES
> /**
> * ghes_register_vendor_record_notifier - register a notifier for vendor
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-30 19:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 17:21 [PATCH] ACPI: extlog: Report error severity using GHES bindings in MCE Pierre Gondois
2026-11-30 17:22 ` Pierre Gondois
2026-11-30 19:28 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox