From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796058492; b=tJGH8gpWLCsAVqg8uzeJgsFjMPM6GJNx4TneaWMzSpDyCUY6bVlCURxUm/Z/LanPTeSq 7k4h1aNnR//fKkPyAe+I/nhrEA8qeXCb76kdWO62hbLCinqbHiVGC99YkZ5a5xGw3qis5 D3QSvdg1/R/ZwFU0DacH+GpmmXAyst4sSahvS3VyB0y3u4sPuTrlxD2ug+pNP1YKgs7Hv zrQyGpKv490VVPrZAbmBqKhi8f5/RwLOfGrfb6Kx7p1jZhSbtuszluee4gDKRy/QaRTS5 AsR4A6hKbk0kykdIbCJmWE7VscoGrjJQHHz8x0HMdw4Wm0492D8LTCKVm5UmntJWP8g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796058492; h=DMARC-Filter:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=B/b1tm1yDpixpsRHWvVKF4aOmHNSjC67/DSEi/AsDFg=; b=nlOGK/9CpUws8Uv8iM89PQ7GrUW2uhPaQ54nuKQgKBsEcL1+JvwiAbuFmBaML4EBmvT+ nnIky8QArpnTp5+EFkD/j8oJzrJa5KOu4B3tKsDyI103RomfIrShUGDvHCSoQnf+WWzkQ 3TdmYQk8wc1YHFBu/tz4ybpKoN2jYhoBNn6cb7GYmDiunOHMNTida1ovmebGOmcfmCrYJ fh1JXt6Kvktc7oVnBd6b6xmUK3MeAysLtkGYvfeYEU9K4++cOLZr98cJt/9yyE6zZDpAL fKG5eazWvTbn2n+nuIC4Bo6Sb624elD8FTZv0xxqb3SUF5sSONCzH7dlM3+23YkUWVQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=cQII0wvM; arc=none smtp.remote-ip=217.140.110.172 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 98FF6606A339; Mon, 30 Nov 2026 17:08:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 98FF6606A339 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=cQII0wvM Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1F00D1595; Mon, 30 Nov 2026 09:08:08 -0800 (PST) Received: from e135073.nice.arm.com (e135073.arm.com [10.34.84.51]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5195A3F86F; Mon, 30 Nov 2026 09:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796058490; bh=TGFenk5phXxVCOR/TE+EjPAT0T6kLtRgI4rYAtKHNFU=; h=From:To:Cc:Subject:Date:From; b=cQII0wvMSVQBIjKblhd8MBChc5ayPHcX3nODROYDvqNFyB0T3YJo3O15YrLQu36fL 7ukFi7a4aWLSsA/jTiS2usaGn2OtDhORSGOllhfj1+spWKDeGka3kk/1TO6isYs+57 bohXlRfiAmh3Xc/7DcOmliyyMv/3V7Urh1nCLnKc= From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Ashok Raj , James Morse , Mark Brown , Pierre Gondois , "Rafael J. Wysocki" , Len Brown , Tony Luck , Borislav Petkov , Hanjun Guo , Mauro Carvalho Chehab , Shuai Xue , Maciej Wieczor-Retman , Pawel Chmielewski , Dave Jiang , Jonathan Cameron , "Fabio M. De Francesco" , Terry Bowman , Dan Williams , Morduan Zang , Breno Leitao , 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 Message-ID: <20261130170438.323355-1-pierre.gondois@arm.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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