Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Aravind Gopalakrishnan and committed by
Borislav Petkov
eba4bfb3 791b4706

+40 -4
+40 -4
drivers/edac/mce_amd.c
··· 78 78 "uop queue", 79 79 "insn buffer", 80 80 "predecode buffer", 81 - "fetch address FIFO" 81 + "fetch address FIFO", 82 + "dispatch uop queue" 82 83 }; 83 84 84 85 static const char * const f15h_mc2_mce_desc[] = { ··· 268 267 pr_cont("System Read Data Error.\n"); 269 268 else 270 269 pr_cont(" Internal error condition type %d.\n", xec); 270 + } else if (INT_ERROR(ec)) { 271 + if (xec <= 0x1f) 272 + pr_cont("Hardware Assert.\n"); 273 + else 274 + ret = false; 275 + 271 276 } else 272 277 ret = false; 273 278 ··· 380 373 pr_cont("%s.\n", f15h_mc1_mce_desc[xec-4]); 381 374 break; 382 375 383 - case 0x11 ... 0x14: 376 + case 0x11 ... 0x15: 384 377 pr_cont("Decoder %s parity error.\n", f15h_mc1_mce_desc[xec-4]); 385 378 break; 386 379 ··· 404 397 bool k8 = (boot_cpu_data.x86 == 0xf && (m->status & BIT_64(58))); 405 398 406 399 pr_cont("during %s.\n", (k8 ? "system linefill" : "NB data read")); 400 + } else if (INT_ERROR(ec)) { 401 + if (xec <= 0x3f) 402 + pr_cont("Hardware Assert.\n"); 403 + else 404 + goto wrong_mc1_mce; 407 405 } else if (fam_ops->mc1_mce(ec, xec)) 408 406 ; 409 407 else 410 - pr_emerg(HW_ERR "Corrupted MC1 MCE info?\n"); 408 + goto wrong_mc1_mce; 409 + 410 + return; 411 + 412 + wrong_mc1_mce: 413 + pr_emerg(HW_ERR "Corrupted MC1 MCE info?\n"); 411 414 } 412 415 413 416 static bool k8_mc2_mce(u16 ec, u8 xec) ··· 485 468 default: 486 469 ret = false; 487 470 } 471 + } else if (INT_ERROR(ec)) { 472 + if (xec <= 0x3f) 473 + pr_cont("Hardware Assert.\n"); 474 + else 475 + ret = false; 488 476 } 489 477 490 478 return ret; ··· 637 615 static void decode_mc5_mce(struct mce *m) 638 616 { 639 617 struct cpuinfo_x86 *c = &boot_cpu_data; 618 + u16 ec = EC(m->status); 640 619 u8 xec = XEC(m->status, xec_mask); 641 620 642 621 if (c->x86 == 0xf || c->x86 == 0x11) 643 622 goto wrong_mc5_mce; 644 623 645 624 pr_emerg(HW_ERR "MC5 Error: "); 625 + 626 + if (INT_ERROR(ec)) { 627 + if (xec <= 0x1f) { 628 + pr_cont("Hardware Assert.\n"); 629 + return; 630 + } else 631 + goto wrong_mc5_mce; 632 + } 646 633 647 634 if (xec == 0x0 || xec == 0xc) 648 635 pr_cont("%s.\n", mc5_mce_desc[xec]); ··· 673 642 pr_emerg(HW_ERR "MC6 Error: "); 674 643 675 644 switch (xec) { 645 + case 0x0: 646 + pr_cont("Hardware Assertion"); 647 + break; 648 + 676 649 case 0x1: 677 650 pr_cont("Free List"); 678 651 break; ··· 892 857 break; 893 858 894 859 case 0x15: 895 - xec_mask = 0x1f; 860 + xec_mask = c->x86_model == 0x60 ? 0x3f : 0x1f; 861 + 896 862 fam_ops->mc0_mce = f15h_mc0_mce; 897 863 fam_ops->mc1_mce = f15h_mc1_mce; 898 864 fam_ops->mc2_mce = f15h_mc2_mce;