[PATCH v5 08/13] efi/cper: Increase memory error record buffer size
From: Pierre Gondois
Date: Mon Nov 30 2026 - 12:09:54 EST
Memory Error Section 2 descriptions can exceed the 256-byte CPER
record buffer. cper_mem_err2_location() needs about 263 characters
when all location fields are valid, for example:
node:65535 card:65535 module:65535 rank:4294967295 bank_group:255
bank_address:255 device:4294967295 row:4294967295 column:4294967295
bit_position:4294967295 requestor_id:0xffffffffffffffff
responder_id:0xffffffffffffffff target_id:0xffffffffffffffff
chip_id:255
cper_dimm_err2_location() needs 17 + strlen(bank) + strlen(device)
characters for a DIMM name, or about 51 characters for the fallback:
DIMM location: not present. DMI handle: 0xffffffff
Increase CPER_REC_LEN to 512 to hold either helper's output.
Signed-off-by: Pierre Gondois <pierre.gondois@xxxxxxx>
---
include/linux/cper.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/cper.h b/include/linux/cper.h
index ada7819447d8..d65b8ad2f8c6 100644
--- a/include/linux/cper.h
+++ b/include/linux/cper.h
@@ -29,9 +29,9 @@
* CPER record length contains the CPER fields which are relevant for further
* handling of a memory error in userspace (we don't carry all the fields
* defined in the UEFI spec because some of them don't make any sense.)
- * Currently, a length of 256 should be more than enough.
+ * Allow room for the wider fields in Memory Error Section 2.
*/
-#define CPER_REC_LEN 256
+#define CPER_REC_LEN 512
/*
* Severity definition for error_severity in struct cper_record_header
* and section_severity in struct cper_section_descriptor
--
2.43.0