From: Ard Biesheuvel <ardb@kernel.org>
To: linux-efi@vger.kernel.org, linux-arch@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Cc: catalin.marinas@arm.com, will@kernel.org,
Ard Biesheuvel <ardb@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Huacai Chen <chenhuacai@loongson.cn>
Subject: [RFC PATCH 0/4] efi: implement generic compressed boot support
Date: Mon, 2 May 2022 13:17:06 +0200 [thread overview]
Message-ID: <20220502111710.4093567-1-ardb@kernel.org> (raw)
Relatively modern architectures such as arm64 or RISC-V don't implement
a self-decompressing kernel, and leave it up to the bootloader to
decompress the compressed image before executing it. Not doing so makes
sense for bare metal boot, as it essentially duplicates a lot of fiddly
preparation work to create a 1:1 mapping and set up the C runtime, and
to discover or infer where DRAM lives from device trees or other
firmware tables.
For EFI boot, the situation is a bit different: the EFI entrypoint is
called with a 1:1 mapping covering all of DRAM already active, and with
a stack, a heap, a memory map and boot services to load and start
images. This means it is rather trivial to implement a
self-decompressing wrapper for EFI boot in a generic manner, and reuse
it across architectures that implement EFI boot.
The downside is that two signatures are needed for UEFI secure boot: one
for the decompressed image and one for the compressed images, as they
are both PE/COFF EFI executables that are launched by the firmware. But
that is actually the whole point, so it is simply the other side of the
same coin.
Related discussion going on here:
https://lore.kernel.org/all/20220430090518.3127980-22-chenhuacai@loongson.cn/
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Huacai Chen <chenhuacai@loongson.cn>
Ard Biesheuvel (4):
efi: stub: add prototypes for load_image and start_image
efi: stub: split off printk() routines
efi: stub: implement generic EFI zboot
arm64: efi: enable generic EFI compressed boot
arch/arm64/Makefile | 5 +
arch/arm64/boot/Makefile | 17 ++-
drivers/firmware/efi/Kconfig | 6 +
drivers/firmware/efi/libstub/Makefile | 4 +-
drivers/firmware/efi/libstub/efi-stub-helper.c | 141 -----------------
drivers/firmware/efi/libstub/efistub.h | 8 +-
drivers/firmware/efi/libstub/printk.c | 158 ++++++++++++++++++++
drivers/firmware/efi/libstub/zboot-header.S | 88 +++++++++++
drivers/firmware/efi/libstub/zboot.c | 86 +++++++++++
drivers/firmware/efi/libstub/zboot.lds | 44 ++++++
10 files changed, 412 insertions(+), 145 deletions(-)
create mode 100644 drivers/firmware/efi/libstub/printk.c
create mode 100644 drivers/firmware/efi/libstub/zboot-header.S
create mode 100644 drivers/firmware/efi/libstub/zboot.c
create mode 100644 drivers/firmware/efi/libstub/zboot.lds
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2022-05-02 11:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-02 11:17 Ard Biesheuvel [this message]
2022-05-02 11:17 ` [RFC PATCH 1/4] efi: stub: add prototypes for load_image and start_image Ard Biesheuvel
2022-05-02 11:17 ` [RFC PATCH 2/4] efi: stub: split off printk() routines Ard Biesheuvel
2022-05-02 11:17 ` [RFC PATCH 3/4] efi: stub: implement generic EFI zboot Ard Biesheuvel
2022-05-02 11:17 ` [RFC PATCH 4/4] arm64: efi: enable generic EFI compressed boot Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220502111710.4093567-1-ardb@kernel.org \
--to=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@loongson.cn \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).