]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: kexec: Align the kexeced kernel entry
authorSong Shuai <songshuaishuai@tinylab.org>
Wed, 6 Sep 2023 09:58:17 +0000 (17:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 09:11:09 +0000 (11:11 +0200)
commitdd8fce4e2da5f2966694cb9179fc8cc908f27525
treeaa03b5d321d7e3eda001d8edd09386076ecbf31b
parente9b8e266105a6ef495ddc817b5d924c5915d8017
riscv: kexec: Align the kexeced kernel entry

[ Upstream commit 1bfb2b618d52e59a4ef1896b46c4698ad2be66b7 ]

The current riscv boot protocol requires 2MB alignment for RV64
and 4MB alignment for RV32.

In KEXEC_FILE path, the elf_find_pbase() function should align
the kexeced kernel entry according to the requirement, otherwise
the kexeced kernel would silently BUG at the setup_vm().

Fixes: 8acea455fafa ("RISC-V: Support for kexec_file on panic")
Signed-off-by: Song Shuai <songshuaishuai@tinylab.org>
Link: https://lore.kernel.org/r/20230906095817.364390-1-songshuaishuai@tinylab.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/kernel/elf_kexec.c