From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796306419; b=SmhtNaZBgyPEBzk+cN/mOwfd5u4L5YGIZFEefeUWmGYjaxVJu/h36RanypJ9gIXWowSu UB3nnL3F2r0HX+XJw0NyIQ4jXZ8FgdZ4J8vtt0aCBNN/7KUWVdqWtW6+8Nk7g2VMZvuXA vssdIh+w8j3HmCqOQDzfFjdZ38WKanYx8bvWo7v5Fr10QOA296y/vO8cFDnnF/s9Vcmi7 yer2q523FZUOQtbzqG2I15iIRz5YWa7TM/o6sv1vI+sBMPilQs5aEs1fXVngNCjh5HTF2 xx+7CUIIxDN2dXXTSfTcsP60389Ma8+UvnGZn7cE+Wgu644imZI1L736QGQExW40+ew== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796306419; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=7IgFfYTIsNRtp7kqjadS1l5m6Qi+o8EX9xH1qPamI8U=; b=LtzLZ4iX68NbxTRTDp03Re05wQ/PlkV2fXw/Le2WlFz9ewjYY+YMTpdWrddJ9eZoMiEu xBGPxDMZ5el4iE8sgq4nJMK3cA6wUdGkZPSxYkX7UmezW0ZaC2271V1EuGd9lpQLTEqZ2 22xv5k5y3zCvJO+Ahc2NnVxhNxdrsh5T7Zef9nxGsvfPFKREyGJw0+Cg17h30ruOxBj6t xi1i9viV5/fSlRVevLTzQMySr1aQJX4N9O4wSO0NfmGVJh0ZCy7S9fkF03386v5ZbWZ86 TsiDIUb83dqOcZwU7DNApRTc/T5W/UTC1r3U2DagiMug2kg50HlyFd3/1F/pbUr/dBg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Ns/yncUv"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE8A9606A32D; Thu, 3 Dec 2026 14:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ns/yncUv Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BF961F00893; Thu, 3 Dec 2026 14:00:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796306418; bh=7IgFfYTIsNRtp7kqjadS1l5m6Qi+o8EX9xH1qPamI8U=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Ns/yncUvS4Zze9dMjZePo6abqVb9EcbLmtd33DAiR9iFMn9ZmvqDWlJmL30E/y0Eb kpZ/4kGoo0cHQ/+rDpl46I1JDXe06Axw7ITb66XJtAN39GlTTaS4DIJUHVdLdcvMfq EROzJYkfmwZhL8arG5tUnLne5QWH59IxoS01S0FCbqnPAbn5K5K/XgGo0zvf7N8hRf 4IX64z3sx/OpnwYRAXaChU0YXlIfy8IowWd2JVGOStPvYRsI/ESxi9jDgG9SUDNgl+ 9KPbIw/X20gla31HUPduttVEy1Ij1b3SMeKH0htOvUVqO/UaBfeFahhS24T5/zh81t iHzkxIW3rFThw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v8 13/22] ACPI: APEI: GHES: share macros via a private header Reply-To: sashiko-reviews@lists.linux.dev To: "Ahmed Tiba" Cc: linux-cxl@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261203-topics-ahmtib01-ras_ffh_arm_internal_review-v8-13-157aac88560b@arm.com> References: <20261203-topics-ahmtib01-ras_ffh_arm_internal_review-v8-0-157aac88560b@arm.com> <20261203-topics-ahmtib01-ras_ffh_arm_internal_review-v8-13-157aac88560b@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 14:00:17 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] ACPI: APEI: driver-private GHES internals exposed in global ghes_cper.h -- commit ca14caa454315f863bdd0d79215b5663a8745fef Author: Ahmed Tiba ACPI: APEI: GHES: share macros via a private header This commit moves GHES CPER helper macros, struct ghes_vendor_record_entry, and several estatus and lifecycle helper prototypes from drivers/acpi/apei/ghes.c into a new header include/acpi/ghes_cper.h, droppi= ng static visibility on those functions in ghes.c. > diff --git a/include/acpi/ghes_cper.h b/include/acpi/ghes_cper.h > new file mode 100644 > index 0000000000000..fca7b55ab0148 > --- /dev/null > +++ b/include/acpi/ghes_cper.h > @@ -0,0 +1,103 @@ [ ... ] > +#define GHES_ESOURCE_PREALLOC_MAX_SIZE 65536 > + > +#define GHES_ESTATUS_POOL_MIN_ALLOC_ORDER 3 > + > +/* This is just an estimation for memory pool allocation */ > +#define GHES_ESTATUS_CACHE_AVG_SIZE 512 > + > +#define GHES_ESTATUS_CACHES_SIZE 4 > + > +#define GHES_ESTATUS_IN_CACHE_MAX_NSEC 10000000000ULL > +/* Prevent too many caches are allocated because of RCU */ > +#define GHES_ESTATUS_CACHE_ALLOCED_MAX (GHES_ESTATUS_CACHES_SIZE * 3 / 2) > + > +#define GHES_ESTATUS_CACHE_LEN(estatus_len) \ > + (sizeof(struct ghes_estatus_cache) + (estatus_len)) > +#define GHES_ESTATUS_FROM_CACHE(estatus_cache) \ > + ((struct acpi_hest_generic_status *) \ > + ((struct ghes_estatus_cache *)(estatus_cache) + 1)) > + > +#define GHES_ESTATUS_NODE_LEN(estatus_len) \ > + (sizeof(struct ghes_estatus_node) + (estatus_len)) > +#define GHES_ESTATUS_FROM_NODE(estatus_node) \ > + ((struct acpi_hest_generic_status *) \ > + ((struct ghes_estatus_node *)(estatus_node) + 1)) > + > +#define GHES_VENDOR_ENTRY_LEN(gdata_len) \ > + (sizeof(struct ghes_vendor_record_entry) + (gdata_len)) > +#define GHES_GDATA_FROM_VENDOR_ENTRY(vendor_entry) \ > + ((struct acpi_hest_generic_data *) \ > + ((struct ghes_vendor_record_entry *)(vendor_entry) + 1)) > + > +static inline bool is_hest_type_generic_v2(struct ghes *ghes) > +{ > + return ghes->generic->header.type =3D=3D ACPI_HEST_TYPE_GENERIC_ERROR_V= 2; > +} > + > +/* > + * A platform may describe one error source for the handling of synchron= ous > + * errors (e.g. MCE or SEA), or for handling asynchronous errors (e.g. S= CI > + * or External Interrupt). On x86, the HEST notifications are always > + * asynchronous, so only SEA on ARM is delivered as a synchronous > + * notification. > + */ > +static inline bool is_hest_sync_notify(struct ghes *ghes) > +{ > + u8 notify_type =3D ghes->generic->notify.type; > + > + return notify_type =3D=3D ACPI_HEST_NOTIFY_SEA; > +} > + > +struct ghes_vendor_record_entry { > + struct work_struct work; > + int error_severity; > + char vendor_record[]; > +}; > + > +#ifdef CONFIG_ACPI_APEI > +struct ghes *ghes_new(struct acpi_hest_generic *generic); > +void ghes_fini(struct ghes *ghes); > + > +int __ghes_peek_estatus(struct ghes *ghes, > + struct acpi_hest_generic_status *estatus, > + u64 *buf_paddr, enum fixed_addresses fixmap_idx); > +int __ghes_check_estatus(struct ghes *ghes, > + struct acpi_hest_generic_status *estatus); > +int __ghes_read_estatus(struct acpi_hest_generic_status *estatus, > + u64 buf_paddr, enum fixed_addresses fixmap_idx, > + size_t buf_len); > +int ghes_read_estatus(struct ghes *ghes, > + struct acpi_hest_generic_status *estatus, > + u64 *buf_paddr, enum fixed_addresses fixmap_idx); > +void ghes_clear_estatus(struct ghes *ghes, > + struct acpi_hest_generic_status *estatus, > + u64 buf_paddr, enum fixed_addresses fixmap_idx); > +#endif [Severity: Low] Should these driver-private declarations live in the global include/acpi/ghes_cper.h header? While drivers/ras/cper-esource.c (added in commit "RAS: add firmware-first CPER provider") needs a shared header under include/acpi/ for GHES_PFX, GHES_ESTATUS_MAX_SIZE, and the CPER reporting entry points, almost everythi= ng added here is never used outside drivers/acpi/apei/. GHES_ESTATUS_NODE_LEN(), GHES_ESTATUS_FROM_NODE(), and is_hest_sync_notify() are only used in drivers/acpi/apei/ghes.c, while the pool/cache tuning macr= os, vendor record definitions, and is_hest_type_generic_v2() are only used in drivers/acpi/apei/ghes_cper.c. The lifecycle and fixmap helpers (ghes_new() through ghes_clear_estatus()) = are shared only between ghes.c and ghes_cper.c, yet are exposed globally without documenting their ownership or locking contracts: ghes_fini() does not free the struct ghes allocated by ghes_new(), and the fixmap helpers require cal= ler serialization for fixmap_idx. Keeping single-file internals local and placing the APEI-internal cross-file prototypes in drivers/acpi/apei/apei-internal.h would keep include/acpi/ghes_cper.h focused on the cross-subsystem API. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-topics-ahm= tib01-ras_ffh_arm_internal_review-v8-0-157aac88560b@arm.com?part=3D13