riscv: kexec_file: Split the loading of kernel and others
authorSong Shuai <songshuaishuai@tinylab.org>
Wed, 9 Apr 2025 19:29:58 +0000 (21:29 +0200)
committerPalmer Dabbelt <palmer@dabbelt.com>
Thu, 5 Jun 2025 18:09:33 +0000 (11:09 -0700)
commit1df45f8a9fea5a7513bd1bad98604ce1fbefcaaf
tree2e7b688b41336f30d0f6a7807748133d359b6e0d
parent9c32cda43eb78f78c73aee4aa344b777714e259b
riscv: kexec_file: Split the loading of kernel and others

This is the preparative patch for kexec_file_load Image support.

It separates the elf_kexec_load() as two parts:
- the first part loads the vmlinux (or Image)
- the second part loads other segments (e.g. initrd,fdt,purgatory)

And the second part is exported as the load_extra_segments() function
which would be used in both kexec-elf.c and kexec-image.c.

No functional change intended.

Signed-off-by: Song Shuai <songshuaishuai@tinylab.org>
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Link: https://lore.kernel.org/r/20250409193004.643839-2-bjorn@kernel.org
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
arch/riscv/include/asm/kexec.h
arch/riscv/kernel/Makefile
arch/riscv/kernel/elf_kexec.c [deleted file]
arch/riscv/kernel/kexec_elf.c [new file with mode: 0644]
arch/riscv/kernel/machine_kexec_file.c