Commit Graph

2 Commits

Author SHA1 Message Date
Youling Tang
55d990f008 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>
2025-10-02 22:39:07 +08:00
Youling Tang
30ade4fef7 LoongArch: Add struct loongarch_image_header for kernel
Define a dedicated image header structure for LoongArch architecture to
standardize kernel loading in bootloaders (primarily for kexec_file).

This header includes critical metadata, such as PE/DOS signature, kernel
entry points, kernel image size and load address offset, etc.

Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2025-10-02 22:39:07 +08:00