OSDN Git Service

hw: arm: Support direct boot for Linux/arm64 EFI zboot images
authorArd Biesheuvel <ardb@kernel.org>
Fri, 3 Mar 2023 16:01:09 +0000 (17:01 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 6 Mar 2023 14:08:12 +0000 (14:08 +0000)
commitff11422804cd03494cc98691eecd3909ea09ab6f
tree155b9818fb7f5985dddbc55c24356242a06c29b8
parent0ffe5b7ba883c6adbbf821f9be03475d96a2e35c
hw: arm: Support direct boot for Linux/arm64 EFI zboot images

Fedora 39 will ship its arm64 kernels in the new generic EFI zboot
format, using gzip compression for the payload.

For doing EFI boot in QEMU, this is completely transparent, as the
firmware or bootloader will take care of this. However, for direct
kernel boot without firmware, we will lose the ability to boot such
distro kernels unless we deal with the new format directly.

EFI zboot images contain metadata in the header regarding the placement
of the compressed payload inside the image, and the type of compression
used. This means we can wire up the existing gzip support without too
much hassle, by parsing the header and grabbing the payload from inside
the loaded zboot image.

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Message-id: 20230303160109.3626966-1-ardb@kernel.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: tweaked comment formatting, fixed checkpatch nits]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/boot.c
hw/core/loader.c
include/hw/loader.h