Re: [RFC PATCH 2/3] powernv/mce: Print correct severity for mce error.
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2019-03-29 00:24:59
Mahesh J Salgaonkar [off-list ref] writes:
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/include/asm/mce.h b/arch/powerpc/include/asm/mce.h index 8d0b1c24c636..314ed3f13d59 100644 --- a/arch/powerpc/include/asm/mce.h +++ b/arch/powerpc/include/asm/mce.h@@ -110,17 +110,18 @@ enum MCE_LinkErrorType { }; struct machine_check_event { - enum MCE_Version version:8; /* 0x00 */ - uint8_t in_use; /* 0x01 */ - enum MCE_Severity severity:8; /* 0x02 */ - enum MCE_Initiator initiator:8; /* 0x03 */ - enum MCE_ErrorType error_type:8; /* 0x04 */ - enum MCE_Disposition disposition:8; /* 0x05 */ - uint16_t cpu; /* 0x06 */ - uint64_t gpr3; /* 0x08 */ - uint64_t srr0; /* 0x10 */ - uint64_t srr1; /* 0x18 */ - union { /* 0x20 */ + enum MCE_Version version:8; + uint8_t in_use; + enum MCE_Severity severity:8; + enum MCE_Initiator initiator:8; + enum MCE_ErrorType error_type:8; + enum MCE_Disposition disposition:8; + uint8_t sync_error; + uint16_t cpu; + uint64_t gpr3; + uint64_t srr0; + uint64_t srr1;
Can you switch these to use kernel types while you're at it, ie. u8, u64 etc.
quoted hunk ↗ jump to hunk
@@ -194,6 +195,7 @@ struct mce_error_info { } u; enum MCE_Severity severity:8; enum MCE_Initiator initiator:8; + uint8_t sync_error;
u8 here but bool later?
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/kernel/mce_power.c b/arch/powerpc/kernel/mce_power.c index 6b800eec31f2..06161de19060 100644 --- a/arch/powerpc/kernel/mce_power.c +++ b/arch/powerpc/kernel/mce_power.c@@ -133,106 +133,107 @@ struct mce_ierror_table { unsigned int error_subtype; unsigned int initiator; unsigned int severity; + bool sync_error; };
ie. here it's a bool?
quoted hunk ↗ jump to hunk
@@ -539,8 +543,9 @@ static int mce_handle_derror(struct pt_regs *regs, return handled; 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->sync_error = 1;
u8 or bool? cheers