Skip to content

arm64: make kexec_file able to load zboot image

Pingfan Liu kexec linux-arm-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6arm64: kexec: Rename kexec_image.c to kexec_raw_image.carch/arm64/include/asm/kexec.h arch/arm64/kernel/Makefile arch/arm64/kernel/kexec_raw_image.c +1 more+4 -40 replies
2/6lib/decompress: Introduce decompress_method_by_name()include/linux/decompress/generic.h lib/decompress.c+15 -10 replies
3/6arm64: Kconfig: Pick decompressing method for kexec file loadarch/arm64/Kconfig lib/Kconfig+62 -00 replies
4/6lib/decompress: Keep decompress routines based on selectioninclude/linux/decompress/mm.h lib/decompress.c+11 -30 replies
5/6arm64: kexec: Introduce zboot image loaderarch/arm64/include/asm/kexec.h arch/arm64/kernel/Makefile arch/arm64/kernel/kexec_zboot_image.c +3 more+217 -10 replies
6/6init/Kconfig: Select decompressing method if compressing kernelinit/Kconfig+7 -00 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by.

PatchLinux Kernel Functional Testing
SeriesT-b
1/6
2/6
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] arm64: make kexec_file able to load zboot image

After introducing zboot image, kexec_file can not load and jump to the new style image. Hence it demands a method to load the new kernel.

The crux of the problem lies in when and how to decompress the Image.gz. There are three possible courses to take: -1. in user space, but hard to achieve due to the signature verification inside the kernel. -2. at the boot time, let the efi_zboot_entry() handles it, which means a simulated EFI service should be provided to that entry, especially about how to be aware of the memory layout. -3. in kernel space, during the file load of the zboot image. At that point, the kernel masters the whole memory information, and easily allocates a suitable memory for the decompressed kernel image. (I think this is similar to what grub does today).

The core of this series is [5/6]. [3,6/6] handles the config option. The assumption of [3/6] is kexec_file_load is independent of zboot, especially it can load kernel images compressed with different compression method. [6/6] is if EFI_ZBOOT, the corresponding decompression method should be included.

Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: [email protected]
To: [email protected]
To: [email protected]

Pingfan Liu (6):
arm64: kexec: Rename kexec_image.c to kexec_raw_image.c lib/decompress: Introduce decompress_method_by_name()
arm64: Kconfig: Pick decompressing method for kexec file load lib/decompress: Keep decompress routines based on selection
arm64: kexec: Introduce zboot image loader init/Kconfig: Select decompressing method if compressing kernel

 arch/arm64/Kconfig                            |  59 ++++++
 arch/arm64/include/asm/kexec.h                |   4 +-
 arch/arm64/kernel/Makefile                    |   2 +-
 .../{kexec_image.c => kexec_raw_image.c}      |   2 +-
 arch/arm64/kernel/kexec_zboot_image.c         | 186 ++++++++++++++++++
 arch/arm64/kernel/machine_kexec.c             |   1 +
 arch/arm64/kernel/machine_kexec_file.c        |   3 +-
 include/linux/decompress/generic.h            |   2 +
 include/linux/decompress/mm.h                 |   9 +-
 include/linux/zboot.h                         |  26 +++
 init/Kconfig                                  |   7 +
 lib/Kconfig                                   |   3 +
 lib/decompress.c                              |  17 +-
 13 files changed, 314 insertions(+), 7 deletions(-)
 rename arch/arm64/kernel/{kexec_image.c => kexec_raw_image.c} (98%)
 create mode 100644 arch/arm64/kernel/kexec_zboot_image.c
 create mode 100644 include/linux/zboot.h
Signature · 1 line
2.31.1