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

powerpc/mce: save ignore_event flag unconditionally for UE

When we hit an UE while using machine check safe copy routines,
ignore_event flag is set and the event is ignored by mce handler,
And the flag is also saved for defered handling and printing of
mce event information, But as of now saving of this flag is done
on checking if the effective address is provided or physical address
is calculated, which is not right.

Save ignore_event flag regardless of whether the effective address is
provided or physical address is calculated.

Without this change following log is seen, when the event is to be
ignored.

[ 512.971365] MCE: CPU1: machine check (Severe) UE Load/Store [Recovered]
[ 512.971509] MCE: CPU1: NIP: [c0000000000b67c0] memcpy+0x40/0x90
[ 512.971655] MCE: CPU1: Initiator CPU
[ 512.971739] MCE: CPU1: Unknown
[ 512.972209] MCE: CPU1: machine check (Severe) UE Load/Store [Recovered]
[ 512.972334] MCE: CPU1: NIP: [c0000000000b6808] memcpy+0x88/0x90
[ 512.972456] MCE: CPU1: Initiator CPU
[ 512.972534] MCE: CPU1: Unknown

Signed-off-by: Ganesh Goudar <ganeshgr@linux.ibm.com>
Reviewed-by: Santosh Sivaraj <santosh@fossix.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210407045816.352276-1-ganeshgr@linux.ibm.com

authored by

Ganesh Goudar and committed by
Michael Ellerman
92d9d61b eacf4c02

+2 -1
+2 -1
arch/powerpc/kernel/mce.c
··· 131 131 * Populate the mce error_type and type-specific error_type. 132 132 */ 133 133 mce_set_error_info(mce, mce_err); 134 + if (mce->error_type == MCE_ERROR_TYPE_UE) 135 + mce->u.ue_error.ignore_event = mce_err->ignore_event; 134 136 135 137 if (!addr) 136 138 return; ··· 161 159 if (phys_addr != ULONG_MAX) { 162 160 mce->u.ue_error.physical_address_provided = true; 163 161 mce->u.ue_error.physical_address = phys_addr; 164 - mce->u.ue_error.ignore_event = mce_err->ignore_event; 165 162 machine_check_ue_event(mce); 166 163 } 167 164 }