]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
LoongArch: Add EFI binary support for kexec_file
authorYouling Tang <tangyouling@kylinos.cn>
Thu, 2 Oct 2025 14:39:07 +0000 (22:39 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Thu, 2 Oct 2025 14:39:07 +0000 (22:39 +0800)
commit55d990f0084c2b8ab9321dc59fc11dce855b4d61
tree389c7d076e25ae8db653d5c345ba18c3b852fb0d
parentd162feec6b6e7ed97986118450812fdd7e9ba202
LoongArch: Add EFI binary support for kexec_file

This patch creates kexec_efi_ops to load EFI binary file for
kexec_file_load() syscall.

The efi_kexec_load() as two parts:
- the first part loads the kernel image (vmlinuz.efi or vmlinux.efi)
- the second part loads other segments (e.g: initrd, cmdline, etc)

Currently, pez (vmlinuz.efi) and pei (vmlinux.efi) format images are
supported.

The basic usage (vmlinuz.efi or vmlinux.efi):

1) Load second kernel image:
 # kexec -s -l vmlinuz.efi --initrd=initrd.img --reuse-cmdline

2) Startup second kernel:
 # kexec -e

Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/image.h
arch/loongarch/include/asm/kexec.h
arch/loongarch/kernel/Makefile
arch/loongarch/kernel/kexec_efi.c [new file with mode: 0644]
arch/loongarch/kernel/machine_kexec_file.c