Skip to content

Commit eba4bfb

Browse files
Aravind Gopalakrishnansuryasaimadhu
authored andcommitted
EDAC, MCE, AMD: Add MCE decoding for F15h M60h
Add decoding logic for new Fam15h model 60h. Tested using mce_amd_inj module and works fine. Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> Link: http://lkml.kernel.org/r/1405098795-4678-1-git-send-email-Aravind.Gopalakrishnan@amd.com [ Boris: simplify a bit. ] Signed-off-by: Borislav Petkov <bp@suse.de>
1 parent 791b470 commit eba4bfb

1 file changed

Lines changed: 40 additions & 4 deletions

File tree

‎drivers/edac/mce_amd.c‎

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ static const char * const f15h_mc1_mce_desc[] = {
7878
"uop queue",
7979
"insn buffer",
8080
"predecode buffer",
81-
"fetch address FIFO"
81+
"fetch address FIFO",
82+
"dispatch uop queue"
8283
};
8384

8485
static const char * const f15h_mc2_mce_desc[] = {
@@ -267,6 +268,12 @@ static bool f15h_mc0_mce(u16 ec, u8 xec)
267268
pr_cont("System Read Data Error.\n");
268269
else
269270
pr_cont(" Internal error condition type %d.\n", xec);
271+
} else if (INT_ERROR(ec)) {
272+
if (xec <= 0x1f)
273+
pr_cont("Hardware Assert.\n");
274+
else
275+
ret = false;
276+
270277
} else
271278
ret = false;
272279

@@ -373,7 +380,7 @@ static bool f15h_mc1_mce(u16 ec, u8 xec)
373380
pr_cont("%s.\n", f15h_mc1_mce_desc[xec-4]);
374381
break;
375382

376-
case 0x11 ... 0x14:
383+
case 0x11 ... 0x15:
377384
pr_cont("Decoder %s parity error.\n", f15h_mc1_mce_desc[xec-4]);
378385
break;
379386

@@ -397,10 +404,20 @@ static void decode_mc1_mce(struct mce *m)
397404
bool k8 = (boot_cpu_data.x86 == 0xf && (m->status & BIT_64(58)));
398405

399406
pr_cont("during %s.\n", (k8 ? "system linefill" : "NB data read"));
407+
} else if (INT_ERROR(ec)) {
408+
if (xec <= 0x3f)
409+
pr_cont("Hardware Assert.\n");
410+
else
411+
goto wrong_mc1_mce;
400412
} else if (fam_ops->mc1_mce(ec, xec))
401413
;
402414
else
403-
pr_emerg(HW_ERR "Corrupted MC1 MCE info?\n");
415+
goto wrong_mc1_mce;
416+
417+
return;
418+
419+
wrong_mc1_mce:
420+
pr_emerg(HW_ERR "Corrupted MC1 MCE info?\n");
404421
}
405422

406423
static bool k8_mc2_mce(u16 ec, u8 xec)
@@ -468,6 +485,11 @@ static bool f15h_mc2_mce(u16 ec, u8 xec)
468485
default:
469486
ret = false;
470487
}
488+
} else if (INT_ERROR(ec)) {
489+
if (xec <= 0x3f)
490+
pr_cont("Hardware Assert.\n");
491+
else
492+
ret = false;
471493
}
472494

473495
return ret;
@@ -615,13 +637,22 @@ static void decode_mc4_mce(struct mce *m)
615637
static void decode_mc5_mce(struct mce *m)
616638
{
617639
struct cpuinfo_x86 *c = &boot_cpu_data;
640+
u16 ec = EC(m->status);
618641
u8 xec = XEC(m->status, xec_mask);
619642

620643
if (c->x86 == 0xf || c->x86 == 0x11)
621644
goto wrong_mc5_mce;
622645

623646
pr_emerg(HW_ERR "MC5 Error: ");
624647

648+
if (INT_ERROR(ec)) {
649+
if (xec <= 0x1f) {
650+
pr_cont("Hardware Assert.\n");
651+
return;
652+
} else
653+
goto wrong_mc5_mce;
654+
}
655+
625656
if (xec == 0x0 || xec == 0xc)
626657
pr_cont("%s.\n", mc5_mce_desc[xec]);
627658
else if (xec <= 0xd)
@@ -642,6 +673,10 @@ static void decode_mc6_mce(struct mce *m)
642673
pr_emerg(HW_ERR "MC6 Error: ");
643674

644675
switch (xec) {
676+
case 0x0:
677+
pr_cont("Hardware Assertion");
678+
break;
679+
645680
case 0x1:
646681
pr_cont("Free List");
647682
break;
@@ -857,7 +892,8 @@ static int __init mce_amd_init(void)
857892
break;
858893

859894
case 0x15:
860-
xec_mask = 0x1f;
895+
xec_mask = c->x86_model == 0x60 ? 0x3f : 0x1f;
896+
861897
fam_ops->mc0_mce = f15h_mc0_mce;
862898
fam_ops->mc1_mce = f15h_mc1_mce;
863899
fam_ops->mc2_mce = f15h_mc2_mce;

0 commit comments

Comments
 (0)