Commit cda6618d authored by Mahesh Salgaonkar's avatar Mahesh Salgaonkar Committed by Michael Ellerman

powerpc/powernv/mce: Print correct severity for MCE error.

Currently all machine check errors are printed as severe errors which
isn't correct. Print soft errors as warning instead of severe errors.
Signed-off-by: default avatarMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent d6e8a150
...@@ -31,7 +31,7 @@ enum MCE_Version { ...@@ -31,7 +31,7 @@ enum MCE_Version {
enum MCE_Severity { enum MCE_Severity {
MCE_SEV_NO_ERROR = 0, MCE_SEV_NO_ERROR = 0,
MCE_SEV_WARNING = 1, MCE_SEV_WARNING = 1,
MCE_SEV_ERROR_SYNC = 2, MCE_SEV_SEVERE = 2,
MCE_SEV_FATAL = 3, MCE_SEV_FATAL = 3,
}; };
...@@ -110,73 +110,74 @@ enum MCE_LinkErrorType { ...@@ -110,73 +110,74 @@ enum MCE_LinkErrorType {
}; };
struct machine_check_event { struct machine_check_event {
enum MCE_Version version:8; /* 0x00 */ enum MCE_Version version:8;
uint8_t in_use; /* 0x01 */ u8 in_use;
enum MCE_Severity severity:8; /* 0x02 */ enum MCE_Severity severity:8;
enum MCE_Initiator initiator:8; /* 0x03 */ enum MCE_Initiator initiator:8;
enum MCE_ErrorType error_type:8; /* 0x04 */ enum MCE_ErrorType error_type:8;
enum MCE_Disposition disposition:8; /* 0x05 */ enum MCE_Disposition disposition:8;
uint16_t cpu; /* 0x06 */ bool sync_error;
uint64_t gpr3; /* 0x08 */ u16 cpu;
uint64_t srr0; /* 0x10 */ u64 gpr3;
uint64_t srr1; /* 0x18 */ u64 srr0;
union { /* 0x20 */ u64 srr1;
union {
struct { struct {
enum MCE_UeErrorType ue_error_type:8; enum MCE_UeErrorType ue_error_type:8;
uint8_t effective_address_provided; u8 effective_address_provided;
uint8_t physical_address_provided; u8 physical_address_provided;
uint8_t reserved_1[5]; u8 reserved_1[5];
uint64_t effective_address; u64 effective_address;
uint64_t physical_address; u64 physical_address;
uint8_t reserved_2[8]; u8 reserved_2[8];
} ue_error; } ue_error;
struct { struct {
enum MCE_SlbErrorType slb_error_type:8; enum MCE_SlbErrorType slb_error_type:8;
uint8_t effective_address_provided; u8 effective_address_provided;
uint8_t reserved_1[6]; u8 reserved_1[6];
uint64_t effective_address; u64 effective_address;
uint8_t reserved_2[16]; u8 reserved_2[16];
} slb_error; } slb_error;
struct { struct {
enum MCE_EratErrorType erat_error_type:8; enum MCE_EratErrorType erat_error_type:8;
uint8_t effective_address_provided; u8 effective_address_provided;
uint8_t reserved_1[6]; u8 reserved_1[6];
uint64_t effective_address; u64 effective_address;
uint8_t reserved_2[16]; u8 reserved_2[16];
} erat_error; } erat_error;
struct { struct {
enum MCE_TlbErrorType tlb_error_type:8; enum MCE_TlbErrorType tlb_error_type:8;
uint8_t effective_address_provided; u8 effective_address_provided;
uint8_t reserved_1[6]; u8 reserved_1[6];
uint64_t effective_address; u64 effective_address;
uint8_t reserved_2[16]; u8 reserved_2[16];
} tlb_error; } tlb_error;
struct { struct {
enum MCE_UserErrorType user_error_type:8; enum MCE_UserErrorType user_error_type:8;
uint8_t effective_address_provided; u8 effective_address_provided;
uint8_t reserved_1[6]; u8 reserved_1[6];
uint64_t effective_address; u64 effective_address;
uint8_t reserved_2[16]; u8 reserved_2[16];
} user_error; } user_error;
struct { struct {
enum MCE_RaErrorType ra_error_type:8; enum MCE_RaErrorType ra_error_type:8;
uint8_t effective_address_provided; u8 effective_address_provided;
uint8_t reserved_1[6]; u8 reserved_1[6];
uint64_t effective_address; u64 effective_address;
uint8_t reserved_2[16]; u8 reserved_2[16];
} ra_error; } ra_error;
struct { struct {
enum MCE_LinkErrorType link_error_type:8; enum MCE_LinkErrorType link_error_type:8;
uint8_t effective_address_provided; u8 effective_address_provided;
uint8_t reserved_1[6]; u8 reserved_1[6];
uint64_t effective_address; u64 effective_address;
uint8_t reserved_2[16]; u8 reserved_2[16];
} link_error; } link_error;
} u; } u;
}; };
...@@ -194,6 +195,7 @@ struct mce_error_info { ...@@ -194,6 +195,7 @@ struct mce_error_info {
} u; } u;
enum MCE_Severity severity:8; enum MCE_Severity severity:8;
enum MCE_Initiator initiator:8; enum MCE_Initiator initiator:8;
bool sync_error;
}; };
#define MAX_MC_EVT 100 #define MAX_MC_EVT 100
......
...@@ -122,6 +122,7 @@ void save_mce_event(struct pt_regs *regs, long handled, ...@@ -122,6 +122,7 @@ void save_mce_event(struct pt_regs *regs, long handled,
mce->initiator = mce_err->initiator; mce->initiator = mce_err->initiator;
mce->severity = mce_err->severity; mce->severity = mce_err->severity;
mce->sync_error = mce_err->sync_error;
/* /*
* Populate the mce error_type and type-specific error_type. * Populate the mce error_type and type-specific error_type.
...@@ -376,9 +377,9 @@ void machine_check_print_event_info(struct machine_check_event *evt, ...@@ -376,9 +377,9 @@ void machine_check_print_event_info(struct machine_check_event *evt,
break; break;
case MCE_SEV_WARNING: case MCE_SEV_WARNING:
level = KERN_WARNING; level = KERN_WARNING;
sevstr = ""; sevstr = "Warning";
break; break;
case MCE_SEV_ERROR_SYNC: case MCE_SEV_SEVERE:
level = KERN_ERR; level = KERN_ERR;
sevstr = "Severe"; sevstr = "Severe";
break; break;
......
...@@ -133,106 +133,107 @@ struct mce_ierror_table { ...@@ -133,106 +133,107 @@ struct mce_ierror_table {
unsigned int error_subtype; unsigned int error_subtype;
unsigned int initiator; unsigned int initiator;
unsigned int severity; unsigned int severity;
bool sync_error;
}; };
static const struct mce_ierror_table mce_p7_ierror_table[] = { static const struct mce_ierror_table mce_p7_ierror_table[] = {
{ 0x00000000001c0000, 0x0000000000040000, true, { 0x00000000001c0000, 0x0000000000040000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_IFETCH, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_IFETCH,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000001c0000, 0x0000000000080000, true, { 0x00000000001c0000, 0x0000000000080000, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY, MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000001c0000, 0x00000000000c0000, true, { 0x00000000001c0000, 0x00000000000c0000, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT, MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000000001c0000, 0x0000000000100000, true, { 0x00000000001c0000, 0x0000000000100000, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_INDETERMINATE, /* BOTH */ MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_INDETERMINATE, /* BOTH */
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000000001c0000, 0x0000000000140000, true, { 0x00000000001c0000, 0x0000000000140000, true,
MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT, MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000000001c0000, 0x0000000000180000, true, { 0x00000000001c0000, 0x0000000000180000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_IFETCH, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_IFETCH,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000001c0000, 0x00000000001c0000, true, { 0x00000000001c0000, 0x00000000001c0000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_IFETCH, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_IFETCH,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0, 0, 0, 0, 0, 0 } }; { 0, 0, 0, 0, 0, 0, 0 } };
static const struct mce_ierror_table mce_p8_ierror_table[] = { static const struct mce_ierror_table mce_p8_ierror_table[] = {
{ 0x00000000081c0000, 0x0000000000040000, true, { 0x00000000081c0000, 0x0000000000040000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_IFETCH, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_IFETCH,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x0000000000080000, true, { 0x00000000081c0000, 0x0000000000080000, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY, MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x00000000000c0000, true, { 0x00000000081c0000, 0x00000000000c0000, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT, MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000000081c0000, 0x0000000000100000, true, { 0x00000000081c0000, 0x0000000000100000, true,
MCE_ERROR_TYPE_ERAT,MCE_ERAT_ERROR_MULTIHIT, MCE_ERROR_TYPE_ERAT,MCE_ERAT_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000000081c0000, 0x0000000000140000, true, { 0x00000000081c0000, 0x0000000000140000, true,
MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT, MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000000081c0000, 0x0000000000180000, true, { 0x00000000081c0000, 0x0000000000180000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_IFETCH, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_IFETCH,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x00000000001c0000, true, { 0x00000000081c0000, 0x00000000001c0000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_IFETCH, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_IFETCH,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x0000000008000000, true, { 0x00000000081c0000, 0x0000000008000000, true,
MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_IFETCH_TIMEOUT, MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_IFETCH_TIMEOUT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x0000000008040000, true, { 0x00000000081c0000, 0x0000000008040000, true,
MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_PAGE_TABLE_WALK_IFETCH_TIMEOUT, MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_PAGE_TABLE_WALK_IFETCH_TIMEOUT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0, 0, 0, 0, 0, 0 } }; { 0, 0, 0, 0, 0, 0, 0 } };
static const struct mce_ierror_table mce_p9_ierror_table[] = { static const struct mce_ierror_table mce_p9_ierror_table[] = {
{ 0x00000000081c0000, 0x0000000000040000, true, { 0x00000000081c0000, 0x0000000000040000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_IFETCH, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_IFETCH,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x0000000000080000, true, { 0x00000000081c0000, 0x0000000000080000, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY, MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x00000000000c0000, true, { 0x00000000081c0000, 0x00000000000c0000, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT, MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000000081c0000, 0x0000000000100000, true, { 0x00000000081c0000, 0x0000000000100000, true,
MCE_ERROR_TYPE_ERAT,MCE_ERAT_ERROR_MULTIHIT, MCE_ERROR_TYPE_ERAT,MCE_ERAT_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000000081c0000, 0x0000000000140000, true, { 0x00000000081c0000, 0x0000000000140000, true,
MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT, MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000000081c0000, 0x0000000000180000, true, { 0x00000000081c0000, 0x0000000000180000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_IFETCH, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_IFETCH,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x00000000001c0000, true, { 0x00000000081c0000, 0x00000000001c0000, true,
MCE_ERROR_TYPE_RA, MCE_RA_ERROR_IFETCH_FOREIGN, MCE_ERROR_TYPE_RA, MCE_RA_ERROR_IFETCH_FOREIGN,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x0000000008000000, true, { 0x00000000081c0000, 0x0000000008000000, true,
MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_IFETCH_TIMEOUT, MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_IFETCH_TIMEOUT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x0000000008040000, true, { 0x00000000081c0000, 0x0000000008040000, true,
MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_PAGE_TABLE_WALK_IFETCH_TIMEOUT, MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_PAGE_TABLE_WALK_IFETCH_TIMEOUT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x00000000080c0000, true, { 0x00000000081c0000, 0x00000000080c0000, true,
MCE_ERROR_TYPE_RA, MCE_RA_ERROR_IFETCH, MCE_ERROR_TYPE_RA, MCE_RA_ERROR_IFETCH,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x0000000008100000, true, { 0x00000000081c0000, 0x0000000008100000, true,
MCE_ERROR_TYPE_RA, MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH, MCE_ERROR_TYPE_RA, MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000000081c0000, 0x0000000008140000, false, { 0x00000000081c0000, 0x0000000008140000, false,
MCE_ERROR_TYPE_RA, MCE_RA_ERROR_STORE, MCE_ERROR_TYPE_RA, MCE_RA_ERROR_STORE,
MCE_INITIATOR_CPU, MCE_SEV_FATAL, }, /* ASYNC is fatal */ MCE_INITIATOR_CPU, MCE_SEV_FATAL, false }, /* ASYNC is fatal */
{ 0x00000000081c0000, 0x0000000008180000, false, { 0x00000000081c0000, 0x0000000008180000, false,
MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_STORE_TIMEOUT, MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_STORE_TIMEOUT,
MCE_INITIATOR_CPU, MCE_SEV_FATAL, }, /* ASYNC is fatal */ MCE_INITIATOR_CPU, MCE_SEV_FATAL, false }, /* ASYNC is fatal */
{ 0x00000000081c0000, 0x00000000081c0000, true, { 0x00000000081c0000, 0x00000000081c0000, true,
MCE_ERROR_TYPE_RA, MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH_FOREIGN, MCE_ERROR_TYPE_RA, MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH_FOREIGN,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0, 0, 0, 0, 0, 0 } }; { 0, 0, 0, 0, 0, 0, 0 } };
struct mce_derror_table { struct mce_derror_table {
unsigned long dsisr_value; unsigned long dsisr_value;
...@@ -241,103 +242,104 @@ struct mce_derror_table { ...@@ -241,103 +242,104 @@ struct mce_derror_table {
unsigned int error_subtype; unsigned int error_subtype;
unsigned int initiator; unsigned int initiator;
unsigned int severity; unsigned int severity;
bool sync_error;
}; };
static const struct mce_derror_table mce_p7_derror_table[] = { static const struct mce_derror_table mce_p7_derror_table[] = {
{ 0x00008000, false, { 0x00008000, false,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_LOAD_STORE, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_LOAD_STORE,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00004000, true, { 0x00004000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_LOAD_STORE, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_LOAD_STORE,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000800, true, { 0x00000800, true,
MCE_ERROR_TYPE_ERAT, MCE_ERAT_ERROR_MULTIHIT, MCE_ERROR_TYPE_ERAT, MCE_ERAT_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000400, true, { 0x00000400, true,
MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT, MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000080, true, { 0x00000080, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT, /* Before PARITY */ MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT, /* Before PARITY */
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000100, true, { 0x00000100, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY, MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000040, true, { 0x00000040, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_INDETERMINATE, /* BOTH */ MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_INDETERMINATE, /* BOTH */
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0, false, 0, 0, 0, 0 } }; { 0, false, 0, 0, 0, 0, 0 } };
static const struct mce_derror_table mce_p8_derror_table[] = { static const struct mce_derror_table mce_p8_derror_table[] = {
{ 0x00008000, false, { 0x00008000, false,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_LOAD_STORE, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_LOAD_STORE,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00004000, true, { 0x00004000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_LOAD_STORE, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_LOAD_STORE,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00002000, true, { 0x00002000, true,
MCE_ERROR_TYPE_LINK, MCE_LINK_ERROR_LOAD_TIMEOUT, MCE_ERROR_TYPE_LINK, MCE_LINK_ERROR_LOAD_TIMEOUT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00001000, true, { 0x00001000, true,
MCE_ERROR_TYPE_LINK, MCE_LINK_ERROR_PAGE_TABLE_WALK_LOAD_STORE_TIMEOUT, MCE_ERROR_TYPE_LINK, MCE_LINK_ERROR_PAGE_TABLE_WALK_LOAD_STORE_TIMEOUT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000800, true, { 0x00000800, true,
MCE_ERROR_TYPE_ERAT, MCE_ERAT_ERROR_MULTIHIT, MCE_ERROR_TYPE_ERAT, MCE_ERAT_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000400, true, { 0x00000400, true,
MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT, MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000200, true, { 0x00000200, true,
MCE_ERROR_TYPE_ERAT, MCE_ERAT_ERROR_MULTIHIT, /* SECONDARY ERAT */ MCE_ERROR_TYPE_ERAT, MCE_ERAT_ERROR_MULTIHIT, /* SECONDARY ERAT */
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000080, true, { 0x00000080, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT, /* Before PARITY */ MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT, /* Before PARITY */
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000100, true, { 0x00000100, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY, MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0, false, 0, 0, 0, 0 } }; { 0, false, 0, 0, 0, 0, 0 } };
static const struct mce_derror_table mce_p9_derror_table[] = { static const struct mce_derror_table mce_p9_derror_table[] = {
{ 0x00008000, false, { 0x00008000, false,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_LOAD_STORE, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_LOAD_STORE,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00004000, true, { 0x00004000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_LOAD_STORE, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_LOAD_STORE,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00002000, true, { 0x00002000, true,
MCE_ERROR_TYPE_LINK, MCE_LINK_ERROR_LOAD_TIMEOUT, MCE_ERROR_TYPE_LINK, MCE_LINK_ERROR_LOAD_TIMEOUT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00001000, true, { 0x00001000, true,
MCE_ERROR_TYPE_LINK, MCE_LINK_ERROR_PAGE_TABLE_WALK_LOAD_STORE_TIMEOUT, MCE_ERROR_TYPE_LINK, MCE_LINK_ERROR_PAGE_TABLE_WALK_LOAD_STORE_TIMEOUT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000800, true, { 0x00000800, true,
MCE_ERROR_TYPE_ERAT, MCE_ERAT_ERROR_MULTIHIT, MCE_ERROR_TYPE_ERAT, MCE_ERAT_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000400, true, { 0x00000400, true,
MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT, MCE_ERROR_TYPE_TLB, MCE_TLB_ERROR_MULTIHIT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000200, false, { 0x00000200, false,
MCE_ERROR_TYPE_USER, MCE_USER_ERROR_TLBIE, MCE_ERROR_TYPE_USER, MCE_USER_ERROR_TLBIE,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000080, true, { 0x00000080, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT, /* Before PARITY */ MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_MULTIHIT, /* Before PARITY */
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_WARNING, true },
{ 0x00000100, true, { 0x00000100, true,
MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY, MCE_ERROR_TYPE_SLB, MCE_SLB_ERROR_PARITY,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000040, true, { 0x00000040, true,
MCE_ERROR_TYPE_RA, MCE_RA_ERROR_LOAD, MCE_ERROR_TYPE_RA, MCE_RA_ERROR_LOAD,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000020, false, { 0x00000020, false,
MCE_ERROR_TYPE_RA, MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE, MCE_ERROR_TYPE_RA, MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000010, false, { 0x00000010, false,
MCE_ERROR_TYPE_RA, MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE_FOREIGN, MCE_ERROR_TYPE_RA, MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE_FOREIGN,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0x00000008, false, { 0x00000008, false,
MCE_ERROR_TYPE_RA, MCE_RA_ERROR_LOAD_STORE_FOREIGN, MCE_ERROR_TYPE_RA, MCE_RA_ERROR_LOAD_STORE_FOREIGN,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_SEVERE, true },
{ 0, false, 0, 0, 0, 0 } }; { 0, false, 0, 0, 0, 0, 0 } };
static int mce_find_instr_ea_and_pfn(struct pt_regs *regs, uint64_t *addr, static int mce_find_instr_ea_and_pfn(struct pt_regs *regs, uint64_t *addr,
uint64_t *phys_addr) uint64_t *phys_addr)
...@@ -427,11 +429,12 @@ static int mce_handle_ierror(struct pt_regs *regs, ...@@ -427,11 +429,12 @@ static int mce_handle_ierror(struct pt_regs *regs,
mce_err->u.link_error_type = table[i].error_subtype; mce_err->u.link_error_type = table[i].error_subtype;
break; break;
} }
mce_err->sync_error = table[i].sync_error;
mce_err->severity = table[i].severity; mce_err->severity = table[i].severity;
mce_err->initiator = table[i].initiator; mce_err->initiator = table[i].initiator;
if (table[i].nip_valid) { if (table[i].nip_valid) {
*addr = regs->nip; *addr = regs->nip;
if (mce_err->severity == MCE_SEV_ERROR_SYNC && if (mce_err->sync_error &&
table[i].error_type == MCE_ERROR_TYPE_UE) { table[i].error_type == MCE_ERROR_TYPE_UE) {
unsigned long pfn; unsigned long pfn;
...@@ -448,8 +451,9 @@ static int mce_handle_ierror(struct pt_regs *regs, ...@@ -448,8 +451,9 @@ static int mce_handle_ierror(struct pt_regs *regs,
} }
mce_err->error_type = MCE_ERROR_TYPE_UNKNOWN; mce_err->error_type = MCE_ERROR_TYPE_UNKNOWN;
mce_err->severity = MCE_SEV_ERROR_SYNC; mce_err->severity = MCE_SEV_SEVERE;
mce_err->initiator = MCE_INITIATOR_CPU; mce_err->initiator = MCE_INITIATOR_CPU;
mce_err->sync_error = true;
return 0; return 0;
} }
...@@ -519,11 +523,12 @@ static int mce_handle_derror(struct pt_regs *regs, ...@@ -519,11 +523,12 @@ static int mce_handle_derror(struct pt_regs *regs,
mce_err->u.link_error_type = table[i].error_subtype; mce_err->u.link_error_type = table[i].error_subtype;
break; break;
} }
mce_err->sync_error = table[i].sync_error;
mce_err->severity = table[i].severity; mce_err->severity = table[i].severity;
mce_err->initiator = table[i].initiator; mce_err->initiator = table[i].initiator;
if (table[i].dar_valid) if (table[i].dar_valid)
*addr = regs->dar; *addr = regs->dar;
else if (mce_err->severity == MCE_SEV_ERROR_SYNC && else if (mce_err->sync_error &&
table[i].error_type == MCE_ERROR_TYPE_UE) { table[i].error_type == MCE_ERROR_TYPE_UE) {
/* /*
* We do a maximum of 4 nested MCE calls, see * We do a maximum of 4 nested MCE calls, see
...@@ -539,8 +544,9 @@ static int mce_handle_derror(struct pt_regs *regs, ...@@ -539,8 +544,9 @@ static int mce_handle_derror(struct pt_regs *regs,
return handled; return handled;
mce_err->error_type = MCE_ERROR_TYPE_UNKNOWN; mce_err->error_type = MCE_ERROR_TYPE_UNKNOWN;
mce_err->severity = MCE_SEV_ERROR_SYNC; mce_err->severity = MCE_SEV_SEVERE;
mce_err->initiator = MCE_INITIATOR_CPU; mce_err->initiator = MCE_INITIATOR_CPU;
mce_err->sync_error = true;
return 0; return 0;
} }
......
...@@ -505,7 +505,7 @@ static int opal_recover_mce(struct pt_regs *regs, ...@@ -505,7 +505,7 @@ static int opal_recover_mce(struct pt_regs *regs,
recovered = 0; recovered = 0;
} }
if (!recovered && evt->severity == MCE_SEV_ERROR_SYNC) { if (!recovered && evt->sync_error) {
/* /*
* Try to kill processes if we get a synchronous machine check * Try to kill processes if we get a synchronous machine check
* (e.g., one caused by execution of this instruction). This * (e.g., one caused by execution of this instruction). This
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment