Skip to content

Commit 54ce192

Browse files
weiny2ardbiesheuvel
authored andcommitted
cxl/cper: Fix errant CPER prints for CXL events
Jonathan reports that CXL CPER events dump an extra generic error message. {1}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 1 {1}[Hardware Error]: event severity: recoverable {1}[Hardware Error]: Error 0, type: recoverable {1}[Hardware Error]: section type: unknown, fbcd0a77-c260-417f-85a9-088b1621eba6 {1}[Hardware Error]: section length: 0x90 {1}[Hardware Error]: 00000000: 00000090 00000007 00000000 0d938086 ................ {1}[Hardware Error]: 00000010: 00100000 00000000 00040000 00000000 ................ ... CXL events were rerouted though the CXL subsystem for additional processing. However, when that work was done it was missed that cper_estatus_print_section() continued with a generic error message which is confusing. Teach CPER print code to ignore printing details of some section types. Assign the CXL event GUIDs to this set to prevent confusing unknown prints. Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent 0bcff59 commit 54ce192

File tree

3 files changed

+42
-26
lines changed

3 files changed

+42
-26
lines changed

drivers/acpi/apei/ghes.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -680,32 +680,6 @@ static void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata,
680680
static DECLARE_RWSEM(cxl_cper_rw_sem);
681681
static cxl_cper_callback cper_callback;
682682

683-
/* CXL Event record UUIDs are formatted as GUIDs and reported in section type */
684-
685-
/*
686-
* General Media Event Record
687-
* CXL rev 3.0 Section 8.2.9.2.1.1; Table 8-43
688-
*/
689-
#define CPER_SEC_CXL_GEN_MEDIA_GUID \
690-
GUID_INIT(0xfbcd0a77, 0xc260, 0x417f, \
691-
0x85, 0xa9, 0x08, 0x8b, 0x16, 0x21, 0xeb, 0xa6)
692-
693-
/*
694-
* DRAM Event Record
695-
* CXL rev 3.0 section 8.2.9.2.1.2; Table 8-44
696-
*/
697-
#define CPER_SEC_CXL_DRAM_GUID \
698-
GUID_INIT(0x601dcbb3, 0x9c06, 0x4eab, \
699-
0xb8, 0xaf, 0x4e, 0x9b, 0xfb, 0x5c, 0x96, 0x24)
700-
701-
/*
702-
* Memory Module Event Record
703-
* CXL rev 3.0 section 8.2.9.2.1.3; Table 8-45
704-
*/
705-
#define CPER_SEC_CXL_MEM_MODULE_GUID \
706-
GUID_INIT(0xfe927475, 0xdd59, 0x4339, \
707-
0xa5, 0x86, 0x79, 0xba, 0xb1, 0x13, 0xb7, 0x74)
708-
709683
static void cxl_cper_post_event(enum cxl_event_type event_type,
710684
struct cxl_cper_event_rec *rec)
711685
{

drivers/firmware/efi/cper.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,17 @@ static void cper_print_tstamp(const char *pfx,
523523
}
524524
}
525525

526+
struct ignore_section {
527+
guid_t guid;
528+
const char *name;
529+
};
530+
531+
static const struct ignore_section ignore_sections[] = {
532+
{ .guid = CPER_SEC_CXL_GEN_MEDIA_GUID, .name = "CXL General Media Event" },
533+
{ .guid = CPER_SEC_CXL_DRAM_GUID, .name = "CXL DRAM Event" },
534+
{ .guid = CPER_SEC_CXL_MEM_MODULE_GUID, .name = "CXL Memory Module Event" },
535+
};
536+
526537
static void
527538
cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata,
528539
int sec_no)
@@ -543,6 +554,14 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata
543554
printk("%s""fru_text: %.20s\n", pfx, gdata->fru_text);
544555

545556
snprintf(newpfx, sizeof(newpfx), "%s ", pfx);
557+
558+
for (int i = 0; i < ARRAY_SIZE(ignore_sections); i++) {
559+
if (guid_equal(sec_type, &ignore_sections[i].guid)) {
560+
printk("%ssection_type: %s\n", newpfx, ignore_sections[i].name);
561+
return;
562+
}
563+
}
564+
546565
if (guid_equal(sec_type, &CPER_SEC_PROC_GENERIC)) {
547566
struct cper_sec_proc_generic *proc_err = acpi_hest_get_payload(gdata);
548567

include/linux/cper.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,29 @@ enum {
9090
GUID_INIT(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \
9191
0x72, 0x2D, 0xEB, 0x41)
9292

93+
/* CXL Event record UUIDs are formatted as GUIDs and reported in section type */
94+
/*
95+
* General Media Event Record
96+
* CXL rev 3.0 Section 8.2.9.2.1.1; Table 8-43
97+
*/
98+
#define CPER_SEC_CXL_GEN_MEDIA_GUID \
99+
GUID_INIT(0xfbcd0a77, 0xc260, 0x417f, \
100+
0x85, 0xa9, 0x08, 0x8b, 0x16, 0x21, 0xeb, 0xa6)
101+
/*
102+
* DRAM Event Record
103+
* CXL rev 3.0 section 8.2.9.2.1.2; Table 8-44
104+
*/
105+
#define CPER_SEC_CXL_DRAM_GUID \
106+
GUID_INIT(0x601dcbb3, 0x9c06, 0x4eab, \
107+
0xb8, 0xaf, 0x4e, 0x9b, 0xfb, 0x5c, 0x96, 0x24)
108+
/*
109+
* Memory Module Event Record
110+
* CXL rev 3.0 section 8.2.9.2.1.3; Table 8-45
111+
*/
112+
#define CPER_SEC_CXL_MEM_MODULE_GUID \
113+
GUID_INIT(0xfe927475, 0xdd59, 0x4339, \
114+
0xa5, 0x86, 0x79, 0xba, 0xb1, 0x13, 0xb7, 0x74)
115+
93116
/*
94117
* Flags bits definitions for flags in struct cper_record_header
95118
* If set, the error has been recovered

0 commit comments

Comments
 (0)