]> www.infradead.org Git - nvme.git/commit
powerpc/pseries: Fix scv instruction crash with kexec
authorNicholas Piggin <npiggin@gmail.com>
Tue, 25 Jun 2024 13:40:47 +0000 (23:40 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 28 Jun 2024 12:05:44 +0000 (22:05 +1000)
commit21a741eb75f80397e5f7d3739e24d7d75e619011
tree00a6eeaec021e9ec0e4c3af9831866c91dd996b6
parenta1216e62d039bf63a539bbe718536ec789a853dd
powerpc/pseries: Fix scv instruction crash with kexec

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: 7fa95f9adaee ("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>
arch/powerpc/kexec/core_64.c
arch/powerpc/platforms/pseries/kexec.c
arch/powerpc/platforms/pseries/pseries.h
arch/powerpc/platforms/pseries/setup.c