powerpc/64s: early boot machine check handler
authorNicholas Piggin <npiggin@gmail.com>
Mon, 26 Sep 2022 05:56:17 +0000 (15:56 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 28 Sep 2022 09:22:13 +0000 (19:22 +1000)
commit2f5182cffa43f31c241131a2c10a4ecd8e90fb3e
treea7393ae14c674e9b50b754a75c500070ccb15fe2
parentbf75a3258a40327b73c5b4458ae8102cfa921b40
powerpc/64s: early boot machine check handler

Use the early boot interrupt fixup in the machine check handler to allow
the machine check handler to run before interrupt endian is set up.
Branch to an early boot handler that just does a basic crash, which
allows it to run before ppc_md is set up. MSR[ME] is enabled on the boot
CPU earlier, and the machine check stack is temporarily set to the
middle of the init task stack.

This allows machine checks (e.g., due to invalid data access in real
mode) to print something useful earlier in boot (as soon as udbg is set
up, if CONFIG_PPC_EARLY_DEBUG=y).

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220926055620.2676869-3-npiggin@gmail.com
arch/powerpc/include/asm/asm-prototypes.h
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/traps.c