This RFC patch series adds machine check handling for Power9. Starting from power9 linux will depend on OPAL to handle chip specific processing for extracting MCE error reason. This will allow linux to not worry about chip/CPU specific bit encoding to find out MCE reason. Linux will make OPAL call during MCE interrupt to let OPAL extract the reason and provide a high level machine check event that should help linux to decide further actions to take.
OPAL machine check handler will be supported on Power9 and above. Linux will populated ppc_md.machine_check_early() function pointer if opal supports OPAL_HANDLE_MACHINE_CHECK token. But if opal mce handler does not support processing/extracting MCE reason for current chip, then it will return OPAL_UNSUPPORTED. e.g. new OPAL FW installed on system with Power8 or below. In this case (i.e on Power8 system it will fallback to in-kernel MCE handler as it does today). I have done all my testing in Mambo only. There are few TODOs that I am working on and will make those changes in v2. This early version is to get comments about this approach to support backward compatibility for Machine check handler starting from Power9. Comments are welcome. --- Mahesh Salgaonkar (7): powerpc/book3s: Move machine check event structure to opal-api.h powerpc/book3s: mce: Call opal mce handler to extract MCE error reason. powerpc/book3s: mce: Process the MCE event and recover if possible. powerpc/book3s: Print additional MCE errors introduced in power9. powerpc/book3s: Don't turn on the MSR[ME] bit until opal processes the reason. powerpc/book3s: Display more info for MCE error console log. powerpc/book3s: Display task info for MCE error in user mode. arch/powerpc/include/asm/machdep.h | 2 arch/powerpc/include/asm/mce.h | 114 +-------------- arch/powerpc/include/asm/opal-api.h | 179 ++++++++++++++++++++++++ arch/powerpc/include/asm/opal.h | 3 arch/powerpc/kernel/exceptions-64s.S | 12 +- arch/powerpc/kernel/mce.c | 122 +++++++++++++++- arch/powerpc/kernel/mce_power.c | 38 +++++ arch/powerpc/kernel/traps.c | 15 ++ arch/powerpc/platforms/powernv/opal-wrappers.S | 1 arch/powerpc/platforms/powernv/opal.c | 24 +++ arch/powerpc/platforms/powernv/setup.c | 4 + 11 files changed, 387 insertions(+), 127 deletions(-) -- Mahesh Salgaonkar