riscv: kexec: Fixup irq controller broken in kexec crash path
authorGuo Ren <guoren@linux.alibaba.com>
Thu, 20 Oct 2022 14:16:02 +0000 (10:16 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:28:44 +0000 (11:28 +0100)
commit12f237200c169a8667cf9dca7a40df8d7917b9fd
tree87036885bc41fa54d8df2d79476ce56650fa4e18
parentac00301adb19df54f2eae1efc4bad7447c0156ce
riscv: kexec: Fixup irq controller broken in kexec crash path

[ Upstream commit b17d19a5314a37f7197afd1a0200affd21a7227d ]

If a crash happens on cpu3 and all interrupts are binding on cpu0, the
bad irq routing will cause a crash kernel which can't receive any irq.
Because crash kernel won't clean up all harts' PLIC enable bits in
enable registers. This patch is similar to 9141a003a491 ("ARM: 7316/1:
kexec: EOI active and mask all interrupts in kexec crash path") and
78fd584cdec0 ("arm64: kdump: implement machine_crash_shutdown()"), and
PowerPC also has the same mechanism.

Fixes: fba8a8674f68 ("RISC-V: Add kexec support")
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Xianting Tian <xianting.tian@linux.alibaba.com>
Cc: Nick Kossifidis <mick@ics.forth.gr>
Cc: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/20221020141603.2856206-2-guoren@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/kernel/machine_kexec.c