linux-stable/arch/powerpc/kexec
Nicholas Piggin c550679d60 powerpc/pseries: Fix scv instruction crash with kexec
commit 21a741eb75 upstream.

kexec on pseries disables AIL (reloc_on_exc), required for scv
instruction support, before other CPUs have been shut down. This means
they can execute scv instructions after AIL is disabled, which causes an
interrupt at an unexpected entry location that crashes the kernel.

Change the kexec sequence to disable AIL after other CPUs have been
brought down.

As a refresher, the real-mode scv interrupt vector is 0x17000, and the
fixed-location head code probably couldn't easily deal with implementing
such high addresses so it was just decided not to support that interrupt
at all.

Fixes: 7fa95f9ada ("powerpc/64s: system call support for scv/rfscv instructions")
Cc: stable@vger.kernel.org # v5.9+
Reported-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Closes: https://lore.kernel.org/3b4b2943-49ad-4619-b195-bc416f1d1409@linux.ibm.com
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Tested-by: Gautam Menghani <gautam@linux.ibm.com>
Tested-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Link: https://msgid.link/20240625134047.298759-1-npiggin@gmail.com
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-11 12:47:15 +02:00
..
core.c powerpc/64/kdump: Limit kdump base to 512MB 2022-09-28 19:22:09 +10:00
core_32.c powerpc: Remove CONFIG_FSL_BOOKE 2022-09-26 22:47:37 +10:00
core_64.c powerpc/pseries: Fix scv instruction crash with kexec 2024-07-11 12:47:15 +02:00
crash.c powerpc/crash: save cpu register data in crash_smp_send_stop() 2022-07-28 16:22:13 +10:00
elf_64.c powerpc: If kexec_build_elf_info() fails return immediately from elf64_load() 2021-04-26 16:28:26 -05:00
file_load.c powerpc: Delete unused function delete_fdt_mem_rsv() 2021-03-08 12:06:30 -07:00
file_load_64.c powerpc/kexec: Fix build failure from uninitialised variable 2022-08-10 15:55:20 +10:00
Makefile powerpc/kasan: Disable address sanitization in kexec paths 2022-05-22 15:58:29 +10:00
ranges.c powerpc/64s: Move hash MMU support code under CONFIG_PPC_64S_HASH_MMU 2021-12-09 22:41:13 +11:00
relocate_32.S powerpc: Remove CONFIG_FSL_BOOKE 2022-09-26 22:47:37 +10:00