Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ahmed Tiba" <ahmed.tiba@arm.com>
Cc: linux-cxl@vger.kernel.org, linux-pci@vger.kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v8 20/22] ACPI: APEI: share GHES CPER helpers
Date: Thu, 03 Dec 2026 14:23:51 +0000	[thread overview]
Message-ID: <sashiko-outbox-247954@kernel.org> (raw)
In-Reply-To: <20261203-topics-ahmtib01-ras_ffh_arm_internal_review-v8-20-157aac88560b@arm.com>

Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Medium] ACPI: APEI: KASAN workaround left on ghes.o after moving
  ghes_do_proc()
- [Medium] ACPI: APEI: unconditional acpi/acpi_io.h include breaks
  non-ACPI builds
- [Low] ACPI: APEI: ghes_report_chain moved without registration helpers
- [Low] ACPI: APEI: unused generic param and globals in
  ghes_cper_handle_status()
--

commit b4cf2660e10f22a18061dfcca8c5c5bef17e5dd0
Author: Ahmed Tiba <ahmed.tiba@arm.com>

ACPI: APEI: share GHES CPER helpers

This commit moves the remaining GHES CPER status-processing and
error-status pool helpers from ghes.c into ghes_cper.c, replacing
ghes_do_proc() with a wrapper around ghes_cper_handle_status().  It also
exports ghes_estatus_pool_init() and guards the ACPI APEI fixmap and GAR
I/O helpers under CONFIG_ACPI_APEI.

> diff --git a/drivers/acpi/apei/ghes_cper.c b/drivers/acpi/apei/ghes_cper.c
> index 2037046d9be8b..bceac27ac2747 100644
> --- a/drivers/acpi/apei/ghes_cper.c
> +++ b/drivers/acpi/apei/ghes_cper.c

[ ... ]

> @@ -21,11 +23,20 @@
[ ... ]
> +#include <linux/vmcore_info.h>
> +#include <linux/vmalloc.h>
>  
>  #include <acpi/apei.h>
>  #include <acpi/acpi_io.h>

[Severity: Medium]
Should #include <acpi/acpi_io.h> move inside #ifdef CONFIG_ACPI_APEI?

Unlike linux/acpi.h, include/acpi/acpi_io.h unconditionally includes
asm/acpi.h, which only exists on arm64, loongarch, riscv, and x86.
Building ghes_cper.o without ACPI on other architectures (such as 32-bit
ARM) fails to compile with a missing asm/acpi.h.

> @@ -36,9 +47,500 @@
>  
>  #include "apei-internal.h"
>  
> +ATOMIC_NOTIFIER_HEAD(ghes_report_chain);

[Severity: Low]
Should ghes_register_report_chain() and ghes_unregister_report_chain()
move to ghes_cper.c alongside ghes_report_chain?

Leaving them in ghes.c forces ghes_report_chain to be non-static and
declared extern in ghes_cper.h, and leaves non-ACPI builds
(CONFIG_GHES_CPER_HELPERS without CONFIG_ACPI_APEI_GHES) with no way to
register on ghes_report_chain even though ghes_cper_handle_status() calls
it.

The commit message also says it exports the notifier interfaces, though no
notifier registration helper is moved or exported here.  In addition,
ghes_estatus_pool_init() is exported for modules while the companion CPER
status-handling, printing, and notifier interfaces are not.

[ ... ]

> +void ghes_cper_handle_status(struct device *dev,
> +			     const struct acpi_hest_generic *generic,
> +			     const struct acpi_hest_generic_status *estatus,
> +			     bool sync)

[Severity: Medium]
Does moving the body of ghes_do_proc() into ghes_cper.c reintroduce the
Clang < 18 KASAN stack-frame build failure?

Commit b584bfbd7ec4 ("ACPI: APEI: GHES: Disable KASAN instrumentation when
compile testing with clang < 18") added KASAN_SANITIZE_ghes.o := n in
drivers/acpi/apei/Makefile because ghes_do_proc() exceeded the 2048-byte
frame limit (2768 bytes) on ARCH=arm64 allmodconfig with CONFIG_KASAN and
-Werror.

ghes_do_proc() is now a two-line wrapper in ghes.c, while its body and
CPER section handlers live in ghes_cper.o, built from drivers/Makefile
without a KASAN_SANITIZE override.  That leaves KASAN_SANITIZE_ghes.o := n
stale on ghes.o and re-exposes the -Wframe-larger-than failure on
ghes_cper.o.

[ ... ]

> diff --git a/include/acpi/ghes_cper.h b/include/acpi/ghes_cper.h
> index 5821eca46d63d..eb07ec98cc94f 100644
> --- a/include/acpi/ghes_cper.h
> +++ b/include/acpi/ghes_cper.h

[ ... ]

> @@ -107,6 +110,23 @@ void ghes_estatus_cache_add(struct acpi_hest_generic *generic,
>  			    struct acpi_hest_generic_status *estatus);
>  void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata,
>  				   int sev);
> +int ghes_severity(int severity);
> +bool ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata,
> +				int sev, bool sync);
> +bool ghes_handle_arm_hw_error(struct acpi_hest_generic_data *gdata,
> +			      int sev, bool sync);
> +void ghes_handle_aer(struct acpi_hest_generic_data *gdata);
> +void ghes_log_hwerr(int sev, guid_t *sec_type);
> +void __ghes_print_estatus(const char *pfx,
> +			  const struct acpi_hest_generic *generic,
> +			  const struct acpi_hest_generic_status *estatus);
> +int ghes_print_estatus(const char *pfx,
> +		       const struct acpi_hest_generic *generic,
> +		       const struct acpi_hest_generic_status *estatus);
> +void ghes_cper_handle_status(struct device *dev,
> +			     const struct acpi_hest_generic *generic,
> +			     const struct acpi_hest_generic_status *estatus,
> +			     bool sync);

[Severity: Low]
Can the unused generic parameter in ghes_cper_handle_status() be dropped?

ghes_cper_handle_status() never references generic, which triggers
-Wunused-parameter warnings under W=2 and forces non-ACPI callers to pass
an unused ACPI HEST descriptor pointer.

Also, ghes_handle_memory_failure(), ghes_handle_arm_hw_error(),
ghes_handle_aer(), and ghes_log_hwerr() have no callers outside
ghes_cper_handle_status() and can stay static instead of being declared in
ghes_cper.h.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-topics-ahmtib01-ras_ffh_arm_internal_review-v8-0-157aac88560b@arm.com?part=20

  reply	other threads:[~2026-12-03 14:23 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 13:40 [PATCH v8 00/22] ACPI: APEI: share GHES CPER helpers and add DT FFH provider Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 01/22] ACPI: APEI: GHES: wait for RCU readers before unmapping Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 02/22] EDAC: ghes: avoid traversing the GHES device list Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 03/22] ACPI: APEI: GHES: track error status pool allocation size Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 04/22] ACPI: APEI: GHES: drain deferred work before freeing a source Ahmed Tiba
2026-12-03 14:00   ` sashiko-bot
2026-12-03 13:40 ` [PATCH v8 05/22] ACPI: APEI: GHES: apply read-acknowledge masks directly Ahmed Tiba
2026-12-03 13:58   ` sashiko-bot
2026-12-03 13:40 ` [PATCH v8 06/22] ACPI: APEI: GHES: revalidate the error status length after copying Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 07/22] ACPI: APEI: GHES: free an estatus cache entry when no slot is found Ahmed Tiba
2026-12-03 13:53   ` sashiko-bot
2026-12-03 13:40 ` [PATCH v8 08/22] efi/cper: include architecture ACPI declarations directly Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 09/22] ACPI: APEI: GHES: allow the error status pool to be extended Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 10/22] ACPI: APEI: GHES: keep task work valid through error reporting Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 11/22] ACPI: APEI: GHES: reset FRU metadata for each CPER section Ahmed Tiba
2026-12-03 13:54   ` sashiko-bot
2026-12-03 13:40 ` [PATCH v8 12/22] efi/cper: validate the remaining length before reading a section Ahmed Tiba
2026-12-03 13:52   ` sashiko-bot
2026-12-03 13:40 ` [PATCH v8 13/22] ACPI: APEI: GHES: share macros via a private header Ahmed Tiba
2026-12-03 14:00   ` sashiko-bot
2026-12-03 13:40 ` [PATCH v8 14/22] ACPI: APEI: GHES: move CPER read helpers Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 15/22] ACPI: APEI: GHES: move GHESv2 ack and alloc helpers Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 16/22] ACPI: APEI: GHES: move estatus cache helpers Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 17/22] ACPI: APEI: GHES: move vendor record helpers Ahmed Tiba
2026-12-03 14:04   ` sashiko-bot
2026-12-03 13:40 ` [PATCH v8 18/22] ACPI: APEI: GHES: move CXL CPER helpers Ahmed Tiba
2026-12-03 14:09   ` sashiko-bot
2026-12-03 13:40 ` [PATCH v8 19/22] ACPI: APEI: introduce GHES CPER helper configuration Ahmed Tiba
2026-12-03 14:19   ` sashiko-bot
2026-12-03 13:40 ` [PATCH v8 20/22] ACPI: APEI: share GHES CPER helpers Ahmed Tiba
2026-12-03 14:23   ` sashiko-bot [this message]
2026-12-03 13:40 ` [PATCH v8 21/22] dt-bindings: firmware: add arm,ras-cper Ahmed Tiba
2026-12-03 13:40 ` [PATCH v8 22/22] RAS: add firmware-first CPER provider Ahmed Tiba
2026-12-03 14:28   ` sashiko-bot

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=sashiko-outbox-247954@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ahmed.tiba@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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