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 22/22] RAS: add firmware-first CPER provider
Date: Thu, 03 Dec 2026 14:28:39 +0000 [thread overview]
Message-ID: <sashiko-outbox-247966@kernel.org> (raw)
In-Reply-To: <20261203-topics-ahmtib01-ras_ffh_arm_internal_review-v8-22-157aac88560b@arm.com>
Thank you for your contribution! Sashiko AI review found 8 potential
issues to consider:
- [High] RAS: RAS_CPER_ESOURCE selects ACPI-only Kconfig symbols on
non-ACPI arches
- [Medium] ACPI: APEI: unguarded acpi/acpi_io.h include breaks non-ACPI
builds
- [Medium] cxl: CXL_RAS depends on ACPI_APEI_GHES, dropping
RAS_CPER_ESOURCE errors
- [Medium] RAS: RAS_CPER_ESOURCE lacks HAS_IOMEM dependency for
devm_ioremap()
- [Medium] RAS: cper_esource_probe() uses devm_kzalloc() for up to 64
KiB estatus
- [Low] RAS: commit message omits cross-subsystem AER, extlog, CXL, and
GHES changes
- [Low] RAS: cper_esource_map_region() maps full region before length
clamping
- [Low] RAS: cper_esource_map_region() returns ERR_PTR() for void
__iomem *
--
commit d8e05a1aeeac8369e2236d27e4905ba75243e89a
Author: Ahmed Tiba <ahmed.tiba@arm.com>
> RAS: add firmware-first CPER provider
>
> Add a firmware-first CPER provider that reuses the shared
> GHES helpers, wire it into the RAS Kconfig/Makefile and
> document it in the admin guide.
>
> Update MAINTAINERS now that the driver exists.
>
> Signed-off-by: Ahmed Tiba <ahmed.tiba@arm.com>
[Severity: Low]
Should the commit message also describe the cross-subsystem changes in
this patch, or could they be split into preparatory commits?
Beyond adding drivers/ras/cper-esource.c, the diff introduces
CONFIG_GHES_CPER_PCIEAER_HELPERS, moves ghes_helpers.o out of
drivers/acpi/apei/Makefile, switches PCIe AER and CXL headers to the
new symbol, adds recovery flags to ghes_cper_handle_status(), and
guards cxl_cper_post_prot_err() in acpi_extlog.c. Explaining why those
changes are needed would help reviewers and future readers of the git
history.
[ ... ]
> diff --git a/drivers/acpi/apei/ghes_cper.c b/drivers/acpi/apei/ghes_cper.c
> index bceac27ac2747..330150f43f5e3 100644
> --- a/drivers/acpi/apei/ghes_cper.c
> +++ b/drivers/acpi/apei/ghes_cper.c
> @@ -42,8 +42,10 @@
> #include <acpi/acpi_io.h>
> #include <acpi/ghes_cper.h>
>
> +#ifdef CONFIG_ACPI_APEI
> #include <asm/fixmap.h>
> #include <asm/tlbflush.h>
> +#endif
>
> #include "apei-internal.h"
[Severity: Medium]
Does leaving <acpi/acpi_io.h> outside the CONFIG_ACPI_APEI guard break
non-ACPI builds on RISC-V?
include/acpi/acpi_io.h unconditionally includes <asm/acpi.h> and
defines an inline acpi_os_ioremap() fallback calling ioremap_cache()
when acpi_os_ioremap is not defined. On RISC-V with CONFIG_ACPI=n,
arch/riscv/include/asm/acpi.h does not define acpi_os_ioremap and
ioremap_cache() does not exist, so compiling ghes_cper.c fails.
Guarding <acpi/acpi_io.h> (and apei_unmap_generic_address() in
apei-internal.h, which calls acpi_os_unmap_generic_address()) with
CONFIG_ACPI_APEI would avoid pulling in ACPI I/O headers on non-ACPI
builds.
[ ... ]
> @@ -868,7 +882,7 @@ struct work_struct *cxl_cper_prot_err_work;
> void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err,
> int severity, u32 len)
> {
> -#ifdef CONFIG_ACPI_APEI_PCIEAER
> +#ifdef CONFIG_GHES_CPER_PCIEAER_HELPERS
> struct cxl_cper_prot_err_work_data wd;
>
> if (cxl_cper_sec_prot_err_valid(prot_err, len))
[Severity: Medium]
Can CXL protocol errors reported through RAS_CPER_ESOURCE ever be
delivered when ACPI_APEI_GHES is disabled?
In drivers/cxl/Kconfig, CXL_RAS still depends on ACPI_APEI_GHES &&
PCIEAER && CXL_BUS. When ACPI_APEI_GHES=n with RAS_CPER_ESOURCE=y,
cxl_ras_init() compiles to a stub, cxl_cper_register_prot_err_work() is
never called, and cxl_cper_post_prot_err() returns early with
cxl_cper_prot_err_work == NULL, silently dropping every CXL protocol
error.
[ ... ]
> diff --git a/drivers/ras/Kconfig b/drivers/ras/Kconfig
> index 070e17639faa3..f416b71ea80ae 100644
> --- a/drivers/ras/Kconfig
> +++ b/drivers/ras/Kconfig
> @@ -56,6 +56,19 @@ config RAS_CEC_DEBUG
>
> source "drivers/ras/amd/atl/Kconfig"
>
> +config RAS_CPER_ESOURCE
> + bool "Firmware-first CPER error source block provider"
> + select GHES_CPER_HELPERS
> + select GHES_CPER_PCIEAER_HELPERS if PCIEAER
[Severity: High]
Does selecting GHES_CPER_HELPERS and GHES_CPER_PCIEAER_HELPERS here
break builds on architectures that do not source drivers/acpi/Kconfig?
Both symbols are defined in drivers/acpi/Kconfig, which is only sourced
by arm64, loongarch, riscv, and x86, whereas drivers/ras/Kconfig is
sourced on all architectures. On any other little-endian architecture
with OF_RESERVED_MEM (such as 32-bit ARM), those symbols remain
undefined, ghes_cper.o and ghes_helpers.o are not built, and linking
cper-esource.o fails with undefined references to the GHES and CPER
helpers.
Note that moving the Kconfig symbols alone is not enough while
ghes_cper.c still pulls in <asm/acpi.h> via <acpi/acpi_io.h>, since
<asm/acpi.h> only exists on those same four architectures.
> + depends on OF_RESERVED_MEM && !CPU_BIG_ENDIAN
[Severity: Medium]
Is a HAS_IOMEM dependency missing here?
cper_esource_map_region() calls devm_ioremap(), which is only built
when CONFIG_HAS_IOMEM is enabled. OF_RESERVED_MEM does not depend on
HAS_IOMEM, so configurations like UML with CONFIG_OF=y and
CONFIG_NO_IOMEM=y can enable RAS_CPER_ESOURCE and fail to link.
[ ... ]
> diff --git a/drivers/ras/cper-esource.c b/drivers/ras/cper-esource.c
> new file mode 100644
> index 0000000000000..221b5f97e335c
> --- /dev/null
> +++ b/drivers/ras/cper-esource.c
[ ... ]
> +static void __iomem *cper_esource_map_region(struct device *dev,
> + unsigned int index, size_t *size,
> + resource_size_t *start)
> +{
> + resource_size_t resource_len;
> + struct resource res;
> + void __iomem *addr;
> +
> + if (of_reserved_mem_region_to_resource(dev->of_node, index, &res))
> + return ERR_PTR(dev_err_probe(dev, -EINVAL,
> + "unable to resolve memory-region %u\n",
> + index));
[Severity: Low]
Should the error returns in cper_esource_map_region() use
IOMEM_ERR_PTR() instead of ERR_PTR()?
The function returns void __iomem *, so returning ERR_PTR() triggers
sparse address-space mismatch warnings on all four error paths.
[ ... ]
> + *size = resource_len;
> + if (start)
> + *start = res.start;
> +
> + addr = devm_ioremap(dev, res.start, *size);
[Severity: Low]
Could cper_esource_map_region() clamp the mapping length before calling
devm_ioremap()?
cper_esource_probe() clamps ctx->status_len to GHES_ESTATUS_MAX_SIZE
after mapping the entire reserved-memory region, and
cper_esource_init_ack() only accesses a single 32-bit word. Mapping
the full unclamped region wastes ioremap virtual address space and can
cause unnecessary -ENOMEM failures if DeviceTree describes a large
region.
[ ... ]
> + ctx->status_len = min_t(size_t, size, GHES_ESTATUS_MAX_SIZE);
[ ... ]
> + ctx->estatus = devm_kzalloc(dev, ctx->status_len, GFP_KERNEL);
[Severity: Medium]
Should ctx->estatus be allocated with kvzalloc() instead of
devm_kzalloc()?
ctx->status_len can be up to GHES_ESTATUS_MAX_SIZE (64 KiB). Because
devm_kzalloc() prepends struct devres and rounds up to a power-of-two
page order, a 64 KiB status buffer turns into a 128 KiB (order-5)
physically contiguous allocation on 4 KiB page kernels, wasting nearly
64 KiB per device and risking compaction stalls or -ENOMEM on
fragmented systems.
ctx->estatus is only accessed by the CPU, so kvzalloc() paired with a
devm_add_action_or_reset() callback calling kvfree() avoids both the
high-order contiguous allocation and the rounding overhead.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-topics-ahmtib01-ras_ffh_arm_internal_review-v8-0-157aac88560b@arm.com?part=22
next prev parent reply other threads:[~2026-12-03 14:28 UTC|newest]
Thread overview: 35+ 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
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 [this message]
2026-12-03 14:28 ` [PATCH v8 00/22] ACPI: APEI: share GHES CPER helpers and add DT FFH provider 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-247966@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