Skip to content

Commit 70fdb49

Browse files
author
Borislav Petkov
committed
EDAC, MCE: Add F15h CU MCE decoder
MCE bank 2 is redefined from a BU to a CU (Combined Unit) bank on F15h. Add a decoder function for CU MCEs. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
1 parent 86039cd commit 70fdb49

1 file changed

Lines changed: 61 additions & 1 deletion

File tree

‎drivers/edac/mce_amd.c‎

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,23 @@ static const char * const f15h_ic_mce_desc[] = {
9595
"fetch address FIFO"
9696
};
9797

98+
static const char * const f15h_cu_mce_desc[] = {
99+
"Fill ECC error on data fills", /* xec = 0x4 */
100+
"Fill parity error on insn fills",
101+
"Prefetcher request FIFO parity error",
102+
"PRQ address parity error",
103+
"PRQ data parity error",
104+
"WCC Tag ECC error",
105+
"WCC Data ECC error",
106+
"WCB Data parity error",
107+
"VB Data/ECC error",
108+
"L2 Tag ECC error", /* xec = 0x10 */
109+
"Hard L2 Tag ECC error",
110+
"Multiple hits on L2 tag",
111+
"XAB parity error",
112+
"PRB address parity error"
113+
};
114+
98115
static bool f12h_dc_mce(u16 ec, u8 xec)
99116
{
100117
bool ret = false;
@@ -405,6 +422,46 @@ static void amd_decode_bu_mce(struct mce *m)
405422
pr_emerg(HW_ERR "Corrupted BU MCE info?\n");
406423
}
407424

425+
static void amd_decode_cu_mce(struct mce *m)
426+
{
427+
u16 ec = m->status & 0xffff;
428+
u8 xec = (m->status >> 16) & xec_mask;
429+
430+
pr_emerg(HW_ERR "Combined Unit Error: ");
431+
432+
if (TLB_ERROR(ec)) {
433+
if (xec == 0x0)
434+
pr_cont("Data parity TLB read error.\n");
435+
else if (xec == 0x1)
436+
pr_cont("Poison data provided for TLB fill.\n");
437+
else
438+
goto wrong_cu_mce;
439+
} else if (BUS_ERROR(ec)) {
440+
if (xec > 2)
441+
goto wrong_cu_mce;
442+
443+
pr_cont("Error during attempted NB data read.\n");
444+
} else if (MEM_ERROR(ec)) {
445+
switch (xec) {
446+
case 0x4 ... 0xc:
447+
pr_cont("%s.\n", f15h_cu_mce_desc[xec - 0x4]);
448+
break;
449+
450+
case 0x10 ... 0x14:
451+
pr_cont("%s.\n", f15h_cu_mce_desc[xec - 0x7]);
452+
break;
453+
454+
default:
455+
goto wrong_cu_mce;
456+
}
457+
}
458+
459+
return;
460+
461+
wrong_cu_mce:
462+
pr_emerg(HW_ERR "Corrupted CU MCE info?\n");
463+
}
464+
408465
static void amd_decode_ls_mce(struct mce *m)
409466
{
410467
u16 ec = m->status & 0xffff;
@@ -665,7 +722,10 @@ int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data)
665722
break;
666723

667724
case 2:
668-
amd_decode_bu_mce(m);
725+
if (boot_cpu_data.x86 == 0x15)
726+
amd_decode_cu_mce(m);
727+
else
728+
amd_decode_bu_mce(m);
669729
break;
670730

671731
case 3:

0 commit comments

Comments
 (0)