Skip to content

Commit d5c6770

Browse files
Borislav PetkovBorislav Petkov
authored andcommitted
MCE, AMD: Dump error status
Dump error status after decoding the error which describes the error disposition. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
1 parent d824c77 commit d5c6770

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

‎drivers/edac/mce_amd.c‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,22 @@ static bool amd_filter_mce(struct mce *m)
667667
return false;
668668
}
669669

670+
static const char *decode_error_status(struct mce *m)
671+
{
672+
if (m->status & MCI_STATUS_UC) {
673+
if (m->status & MCI_STATUS_PCC)
674+
return "System Fatal error.";
675+
if (m->mcgstatus & MCG_STATUS_RIPV)
676+
return "Uncorrected, software restartable error.";
677+
return "Uncorrected, software containable error.";
678+
}
679+
680+
if (m->status & MCI_STATUS_DEFERRED)
681+
return "Deferred error.";
682+
683+
return "Corrected error, no action required.";
684+
}
685+
670686
int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data)
671687
{
672688
struct mce *m = (struct mce *)data;
@@ -712,6 +728,8 @@ int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data)
712728
break;
713729
}
714730

731+
pr_emerg(HW_ERR "Error Status: %s\n", decode_error_status(m));
732+
715733
pr_emerg(HW_ERR "CPU:%d (%x:%x:%x) MC%d_STATUS[%s|%s|%s|%s|%s",
716734
m->extcpu,
717735
c->x86, c->x86_model, c->x86_mask,
@@ -724,8 +742,8 @@ int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data)
724742

725743
if (c->x86 == 0x15)
726744
pr_cont("|%s|%s",
727-
((m->status & BIT_64(44)) ? "Deferred" : "-"),
728-
((m->status & BIT_64(43)) ? "Poison" : "-"));
745+
((m->status & MCI_STATUS_DEFERRED) ? "Deferred" : "-"),
746+
((m->status & MCI_STATUS_POISON) ? "Poison" : "-"));
729747

730748
/* do the two bits[14:13] together */
731749
ecc = (m->status >> 45) & 0x3;

‎drivers/edac/mce_amd.h‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
#define R4(x) (((x) >> 4) & 0xf)
3030
#define R4_MSG(x) ((R4(x) < 9) ? rrrr_msgs[R4(x)] : "Wrong R4!")
3131

32-
/*
33-
* F3x4C bits (MCi_STATUS' high half)
34-
*/
35-
#define NBSH_ERR_CPU_VAL BIT(24)
32+
#define MCI_STATUS_DEFERRED BIT_64(44)
33+
#define MCI_STATUS_POISON BIT_64(43)
3634

3735
enum tt_ids {
3836
TT_INSTR = 0,

0 commit comments

Comments
 (0)