mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre Gondois <pierre.gondois@arm.com>
To: linux-kernel@vger.kernel.org
Cc: Ashok Raj <ashok.raj@oss.qualcomm.com>,
	James Morse <james.morse@arm.com>,
	Mark Brown <broonie@kernel.org>,
	Pierre Gondois <pierre.gondois@arm.com>,
	"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>,
	Dave Jiang <dave.jiang@intel.com>,
	Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>,
	"Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com>,
	Terry Bowman <terry.bowman@amd.com>,
	Dan Williams <djbw@kernel.org>,
	Morduan Zang <zhangdandan@uniontech.com>,
	Breno Leitao <leitao@debian.org>,
	linux-acpi@vger.kernel.org, linux-edac@vger.kernel.org,
	acpica-devel@lists.linux.dev
Subject: [PATCH v5 00/13] CPER: Add Memory Error Section 2 support
Date: Mon, 30 Nov 2026 18:03:09 +0100	[thread overview]
Message-ID: <20261130170438.323355-1-pierre.gondois@arm.com> (raw)

The CPER Memory Error Section allows to report memory related
hardware errors. To support:
- up to 64GiB DIMMs
- DDR4 (bank group and address) and stacked 3DS technology (Chip ID)
the record was introduced a short-term solution:
- Validation Bit18 "Extended Row Bit 16 and 17 Valid"
- an "Extend" field at offset 73.
and a long term solution: a new CPER Memory Error Section 2 record.
The new CPER record was introduced in UEFI 2.5 spec release
(February, 2015).

This patchset aims to add support for this record for existing/future
platforms that might/will use it.


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

V4:
- Re-order patches + split patches following the suggestion at:
https://lore-kernel.gnuweeb.org/linux-edac/20261124151417.GB2156781%40yaz-khff2.amd.com/
- Update of the commit message following the new split.
- No code changes once the serie is applied.

Pierre Gondois (13):
  efi/cper: Prevent buffer overflows in cper_dimm_err_location()
  efi/cper: Prevent buffer overflows in cper_mem_err_location()
  EDAC/ghes: Rationalize buffer usage in for mem other_detail helper
  efi/cper: Use BIT_ULL() for processor and memory validation bits
  EDAC/ghes: Extract error report initialization
  ACPI: APEI: Extract common memory failure handling
  efi/cper: Add Memory Error Section 2 structures
  efi/cper: Increase memory error record buffer size
  efi/cper: Add helpers to handle Memory Error Section 2
  ACPI: APEI: Handle Memory Error Section 2 records in GHES
  EDAC/ghes: Increase memory error location and detail buffers
  EDAC/ghes: Handle Memory Error Section 2 records
  ACPI: extlog: Add Memory Error Section 2 trace event

 drivers/acpi/acpi_extlog.c  |   6 +
 drivers/acpi/apei/ghes.c    |  58 ++++++++--
 drivers/edac/ghes_edac.c    | 211 ++++++++++++++++++++++++++++--------
 drivers/firmware/efi/cper.c | 137 ++++++++++++++++++++---
 drivers/ras/ras.c           |   1 +
 include/acpi/ghes.h         |   2 +
 include/linux/cper.h        | 138 ++++++++++++++++-------
 include/linux/edac.h        |   2 +-
 include/ras/ras_event.h     | 102 +++++++++++++++++
 9 files changed, 548 insertions(+), 109 deletions(-)

--
2.43.0

             reply	other threads:[~2026-11-30 17:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 17:03 Pierre Gondois [this message]
2026-11-30 17:03 ` [PATCH v5 01/13] efi/cper: Prevent buffer overflows in cper_dimm_err_location() Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 02/13] efi/cper: Prevent buffer overflows in cper_mem_err_location() Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 03/13] EDAC/ghes: Rationalize buffer usage in for mem other_detail helper Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 04/13] efi/cper: Use BIT_ULL() for processor and memory validation bits Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 05/13] EDAC/ghes: Extract error report initialization Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 06/13] ACPI: APEI: Extract common memory failure handling Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 07/13] efi/cper: Add Memory Error Section 2 structures Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 08/13] efi/cper: Increase memory error record buffer size Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 09/13] efi/cper: Add helpers to handle Memory Error Section 2 Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 10/13] ACPI: APEI: Handle Memory Error Section 2 records in GHES Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 11/13] EDAC/ghes: Increase memory error location and detail buffers Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 12/13] EDAC/ghes: Handle Memory Error Section 2 records Pierre Gondois
2026-11-30 17:03 ` [PATCH v5 13/13] ACPI: extlog: Add Memory Error Section 2 trace event Pierre Gondois

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=20261130170438.323355-1-pierre.gondois@arm.com \
    --to=pierre.gondois@arm.com \
    --cc=acpica-devel@lists.linux.dev \
    --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=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®