mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yazen Ghannam <yazen.ghannam@amd.com>
To: Pierre Gondois <pierre.gondois@arm.com>
Cc: linux-kernel@vger.kernel.org,
	Ashok Raj <ashok.raj@oss.qualcomm.com>,
	James Morse <james.morse@arm.com>,
	Mark Brown <broonie@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Tony Luck <tony.luck@intel.com>,
	Borislav Petkov <bp@alien8.de>, Hanjun Guo <guohanjun@huawei.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Shuai Xue <xueshuai@linux.alibaba.com>,
	Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
	Pawel Chmielewski <pawel.chmielewski@intel.com>,
	Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Breno Leitao <leitao@debian.org>,
	"Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com>,
	Terry Bowman <terry.bowman@amd.com>,
	Dan Williams <djbw@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
	Morduan Zang <zhangdandan@uniontech.com>,
	linux-acpi@vger.kernel.org, linux-edac@vger.kernel.org,
	acpica-devel@lists.linux.dev
Subject: Re: [PATCH v4 00/12] CPER: Add Memory Error Section 2 support
Date: Tue, 24 Nov 2026 10:14:17 -0500	[thread overview]
Message-ID: <20261124151417.GB2156781@yaz-khff2.amd.com> (raw)
In-Reply-To: <20261113132600.3355836-1-pierre.gondois@arm.com>

On Fri, Nov 13, 2026 at 02:24:42PM +0100, Pierre Gondois wrote:
> The support is mostly duplicated from Memory Error Section handling.
> Other than differences coming from the content of  Memory Error
> Section 1 and 2, differences in the support are:
> 
> - v2 do not rely on a compact "struct cper_mem_err_compact" struct.
> This structure was used to support older versions of the Memory
> Error Section (1). This is not needed for the new structure.
> 
> - The compact version is also used by the tracing framework.
> To avoid relying and propagating a non-standard record format,
> through trace event (cf. extlog_mem event) the new trace event
> prints each field individually.
> 
> The last patch of the serie was only build-tested due to the
> absence of relevant hardware. apei_mce_report_mem_error() and
> arch_apei_report_mem_error() implementations were also removed since
> last version.
> 
> It will also require a proper handling from the rasdaemon. Applying
> this last patch without rasdaemon support will silent the reports of
> Memory Error Section 2 error, cf. ras_userspace_consumers() check.
> 
> Future:
> - _OSC support (if agreed)
> - Addition of arm64 tracepoints
> https://lore.kernel.org/lkml/20261023170405.000060b8@oss.qualcomm.com/
> - Emission of lossy CPER Mem error v1 tracepoints for legacy userspace
>   tools
> https://lore.kernel.org/lkml/at0rs4parlHFGI7k@hu-ashoraj-lv.qualcomm.com/
> 
> 
> RFC: https://lore.kernel.org/all/20260929074659.2587216-1-pierre.gondois@arm.com/#t
> V1:  https://lore.kernel.org/all/20261019145643.1877246-1-pierre.gondois@arm.com/
> - Corrections from Jonathan's review
> - New patch:
>     [PATCH v2 4/6] EDAC/ghes: Extract error report initialization
> - Last patch not in RFC as it has been reviewed by Jonathan@
>     [PATCH v2 6/6] ACPI: extlog: add Memory Error Section 2 trace event
> V2:
> - Updated ghes_edac_init_error() to ghes_edac_init_error_desc(),
>   which now only acts on the input "struct edac_raw_error_desc"
>   + added lockdep_assert_held() to ghes_edac_init_error_desc()
> - Accumulate failures with "queued |=" in ghes_do_proc()
> - New PATCH:
>   [PATCH v3 5/7] ACPI: APEI: Extract common memory failure handling
> 
> V3:
> - Added <linux/bits.h> include
> - Used pr_warn_rate_limited()
> - Removed one warn for smbios handle overflow
> - Replaced __string() -> __string_len() in trace event
> 
> Added patch to us scnprintf():
> - cper: Return actual bytes written by DIMM location helpers
> Added patches to increase buffer size and prevent overflows:
> - EDAC/ghes: Small buffer fixes for mem other_detail helpers
> - efi/cper: Pass buffer length to memory location helpers
> - efi/cper: Pass buffer length to DIMM location helpers
> 
> Pierre Gondois (12):
>   cper: use BIT_ULL() for processor and memory validation bits
>   cper: add Memory Error Section 2 structures
>   cper: add helpers to handle Memory Error Section 2
>   cper: Return actual bytes written by DIMM location helpers

Why not use 'efi/cper' for these ^^^ ?


>   EDAC/ghes: Extract error report initialization
>   ACPI: APEI: Extract common memory failure handling
>   ACPI: APEI: add separate Memory Error Section 2 handlers
>   ACPI: extlog: add Memory Error Section 2 trace event
>   efi/cper: Pass buffer length to DIMM location helpers
>   efi/cper: Pass buffer length to memory location helpers
>   EDAC/ghes: Small buffer fixes for mem other_detail helpers
>   efi/cper: Increase memory error location and detail buffer sizes
> 

Boris already mentioned having fixes go first. I think the common
convention is to have "fixes > refactoring > new feature" order. I asked
an LLM assistant to propose a new patch order (copied at the end). Some
patches would need to be split/reworked, so it's not a strict 1-to-1
reordering. I hope this helps.

Thanks,
Yazen

=== PROPOSED PATCH ORDER ===
A. Fixes and cleanups to the existing Section 1 code (could be sent
   first or as a separate small series)
 A1 efi/cper: Bound the DIMM location to the remaining buffer
    (Section 1 parts of v4 4 and 9: scnprintf, a len parameter, the
    ghes_edac caller passing len - (p - e->location), and stripping
    the trailing char only if it is a space).
    Fixes: ed27b5df3877
 A2 efi/cper: Pass buffer length to cper_mem_err_location()
    (Section 1 part of v4 10, API consistency, not a fix)
 A3 EDAC/ghes: Clean up print_mem_error_other_detail() buffer handling
    (Section 1 part of v4 11, cleanup)
B. Prep with no behavior change
 B1 efi/cper: Use BIT_ULL() for processor and memory validation bits (v4 1)
 B2 EDAC/ghes: Extract error report initialization (v4 5)
 B3 ACPI: APEI: GHES: Extract common memory failure handling (v4 6)
C. Memory Error Section 2
 C1 efi/cper: Add Memory Error Section 2 structures (v4 2)
 C2 efi/cper: Increase CPER_REC_LEN for Memory Error Section 2
    (cper.h part of v4 12)
 C3 efi/cper: Add helpers to handle Memory Error Section 2
    (v4 3 plus the Section 2 parts of 4 and 10: scnprintf and len from
    the start)
 C4 ACPI: APEI: GHES: Add a Memory Error Section 2 handler
    (ghes.c/ghes.h part of v4 7)
 C5 EDAC: Increase LOCATION_SIZE (edac.h part of v4 12)
 C6 EDAC/ghes: Report Memory Error Section 2 errors
    (ghes_edac.c part of v4 7 plus the Section 2 parts of 9 and 11, and
    OTHER_DETAIL_LEN)
 C7 ACPI: extlog: Add a Memory Error Section 2 trace event (v4 8)

Why:
- No bisect gap. Buffer sizes (C2, C5) and length arguments (C3, C6)
  land no later than the code that needs them.
- No API changes after the fact. The Section 2 helpers are added once,
  in final form, instead of changing in v4 4, 9 and 10.
- A1 doesn't depend on Section 2. It can carry Fixes:/Cc: stable and be
  merged while Section 2 is still under discussion (Boris's question,
  _OSC, rasdaemon).
- One maintainer tree per patch (v4 7 and 12 each mix trees).
- Consistent prefixes: efi/cper:, ACPI: APEI: GHES:, EDAC/ghes:, EDAC:.

Caveat: C4 takes Section 2 out of the log_non_standard_event() path.
Nothing else emits a tracepoint for these records until C6, and nothing
ever does without ghes_edac. If C4 keeps calling log_non_standard_event()
(the patch 7 inline question), the order doesn't matter for userspace.
Otherwise squash C4 and C6, or keep them adjacent in the same pull.

      parent reply	other threads:[~2026-11-24 15:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 13:24 Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 01/12] cper: use BIT_ULL() for processor and memory validation bits Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 02/12] cper: add Memory Error Section 2 structures Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 03/12] cper: add helpers to handle Memory Error Section 2 Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 04/12] cper: Return actual bytes written by DIMM location helpers Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 05/12] EDAC/ghes: Extract error report initialization Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 06/12] ACPI: APEI: Extract common memory failure handling Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 07/12] ACPI: APEI: add separate Memory Error Section 2 handlers Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 08/12] ACPI: extlog: add Memory Error Section 2 trace event Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 09/12] efi/cper: Pass buffer length to DIMM location helpers Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 10/12] efi/cper: Pass buffer length to memory " Pierre Gondois
2026-11-13 13:24 ` [PATCH v4 11/12] EDAC/ghes: Small buffer fixes for mem other_detail helpers Pierre Gondois
2026-11-24  4:30   ` Borislav Petkov
2026-11-13 13:24 ` [PATCH v4 12/12] efi/cper: Increase memory error location and detail buffer sizes Pierre Gondois
2026-11-24  4:24 ` [PATCH v4 00/12] CPER: Add Memory Error Section 2 support Borislav Petkov
2026-11-24 15:14 ` Yazen Ghannam [this message]

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=20261124151417.GB2156781@yaz-khff2.amd.com \
    --to=yazen.ghannam@amd.com \
    --cc=acpica-devel@lists.linux.dev \
    --cc=ardb@kernel.org \
    --cc=ashok.raj@oss.qualcomm.com \
    --cc=bp@alien8.de \
    --cc=broonie@kernel.org \
    --cc=dave.jiang@intel.com \
    --cc=djbw@kernel.org \
    --cc=fabio.m.de.francesco@linux.intel.com \
    --cc=guohanjun@huawei.com \
    --cc=james.morse@arm.com \
    --cc=jonathan.cameron@oss.qualcomm.com \
    --cc=leitao@debian.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=mchehab@kernel.org \
    --cc=pawel.chmielewski@intel.com \
    --cc=pierre.gondois@arm.com \
    --cc=rafael@kernel.org \
    --cc=terry.bowman@amd.com \
    --cc=tony.luck@intel.com \
    --cc=xueshuai@linux.alibaba.com \
    --cc=zhangdandan@uniontech.com \
    /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

all inboxes | Powered by JetHome®