efi: Implement generic zboot support
Ard Biesheuvel
maintainercover efi: Implement generic zboot support
This series is a proof-of-concept that implements support for the EFI zboot decompressor for x86. It replaces the ordinary decompressor, and instead, performs the decompression, KASLR randomization and the 4/5 level paging switch while running in the execution context of EFI.
This simplifies things substantially, and makes it straight-forward to abide by stricter future requirements related to the use of writable and executable memory under EFI, which will come into effect on x86 systems that are certified as being 'more secure', and ship with an even shinier Windows sticker.
This is an alternative approach to the work being proposed by Evgeny [0] that makes rather radical changes to the existing decompressor, which has accumulated too many features already, e.g., related to confidential compute etc.
EFI zboot images can be booted in two ways:
- by EFI firmware, which loads and starts it as an ordinary EFI application, just like the existing EFI stub (with which it shares most of its code);
- by a non-EFI loader that parses the image header for the compression metadata, and decompresses the image into memory and boots it.
Realistically, the second option is unlikely to ever be used on x86, given that it already has its existing bzImage, but the first option is a good choice for distros that target EFI boot only (and some distros switched to this format already for arm64). The fact that EFI zboot is implemented in the same way on arm64, RISC-V, LoongArch and [shortly] ARM helps with maintenance, not only of the kernel itself, but also the tooling around it relating to kexec, code signing, deployment, etc.
Series can be pulled from [1], which contains some prerequisite patches that are only tangentially related.
[0] https://lore.kernel.org/all/[email protected]/
[1] https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=efi-x86-zboot
Ard Biesheuvel (3):
efi/libstub: x86: Split off pieces shared with zboot efi/zboot: x86: Implement EFI zboot support efi/zboot: x86: Clear NX restrictions on populated code regions
arch/x86/Makefile | 18 +- arch/x86/include/asm/efi.h | 10 + arch/x86/kernel/head_64.S | 15 + arch/x86/zboot/Makefile | 29 + drivers/firmware/efi/Kconfig | 2 +- drivers/firmware/efi/libstub/Makefile | 15 +- drivers/firmware/efi/libstub/Makefile.zboot | 2 +- drivers/firmware/efi/libstub/efi-stub-helper.c | 3 + drivers/firmware/efi/libstub/x86-stub.c | 592 +------------------ drivers/firmware/efi/libstub/x86-zboot.c | 322 ++++++++++ drivers/firmware/efi/libstub/x86.c | 612 ++++++++++++++++++++ drivers/firmware/efi/libstub/zboot.c | 3 +- drivers/firmware/efi/libstub/zboot.lds | 5 + 13 files changed, 1031 insertions(+), 597 deletions(-) create mode 100644 arch/x86/zboot/Makefile create mode 100644 drivers/firmware/efi/libstub/x86-zboot.c create mode 100644 drivers/firmware/efi/libstub/x86.c
Signature · 1 line
2.39.2
Ard Biesheuvel
maintainerRFC PATCH 1/3 efi/libstub: x86: Split off pieces shared with zboot
In preparation for implementing generic EFI zboot support also on x86, split the X86 pieces into those that can be shared and those that are tied to the way the EFI stub is currently embedded in the bare metal x86 decompressor.
No functional change intended.
--- arch/x86/include/asm/efi.h | 5 + drivers/firmware/efi/libstub/Makefile | 2 +- drivers/firmware/efi/libstub/x86-stub.c | 591 +------------------ drivers/firmware/efi/libstub/x86.c | 612 ++++++++++++++++++++ 4 files changed, 625 insertions(+), 585 deletions(-)
arch/x86/include/asm/efi.h +5 -0
@@ -214,6 +214,11 @@ efi_status_t efi_set_virtual_address_map(unsigned long memory_map_size,/* arch specific definitions used by the stub code */ +struct boot_params *efi_alloc_boot_params (void ); + +efi_status_t efi_x86_stub_common (struct boot_params *boot_params, +efi_handle_t handle); +#ifdef CONFIG_EFI_MIXED #define ARCH_HAS_EFISTUB_WRAPPERS
drivers/firmware/efi/libstub/Makefile +1 -1
@@ -87,7 +87,7 @@ lib-$(CONFIG_EFI_GENERIC_STUB) += efi-stub.o string.o intrinsics.o systable.o \ lib-$(CONFIG_ARM) += arm32-stub.o lib-$(CONFIG_ARM64) += arm64.o arm64-stub.o smbios.o -lib-$(CONFIG_X86) += x86-stub.o +lib-$(CONFIG_X86) += x86.o x86-stub.o lib-$(CONFIG_RISCV) += riscv.o riscv-stub.o lib-$(CONFIG_LOONGARCH) += loongarch.o loongarch-stub.o
drivers/firmware/efi/libstub/x86-stub.c +7 -584
638 lines not on this page · raw message
drivers/firmware/efi/libstub/x86.c new file +612 -0
612 lines not on this page · raw message
Signature · 1 line
2.39.2
Ard Biesheuvel
maintainerRFC PATCH 2/3 efi/zboot: x86: Implement EFI zboot support
In reply to Ard BiesheuvelWire up the Kbuild rules and implement the missing pieces that permit the 64-bit x86 kernel to be built as a EFI zboot image, i.e., the generic self-decompressing format that is already supported for arm64, RISC-V, LoongArch and [shortly] ARM.
Both physical and virtual KASLR are supported, as well as 5 level paging, which are the primary reasons we rely on the bare metal decompressor today.
EFI mixed mode (i.e., running the 64-bit kernel on a 64-bit CPU that booted using 32-bit firmware) is not supported - 32-bit EFI may not enable paging at all, or run with PAE disabled, in which case the long mode switch requires setting up new page tables etc. Implementing mixed mode in a way that only supports 32-bit firmware that enters with paging and PAE enabled should be rather straight-forward, and could be considered as a future enhancement.
Another thing that is not supported is the EFI handover protocol, which has no basis in the EFI spec, and is only implemented by downstream GRUB builds packaged by the distros.
--- arch/x86/Makefile | 18 +- arch/x86/include/asm/efi.h | 5 + arch/x86/kernel/head_64.S | 11 + arch/x86/zboot/Makefile | 29 ++ drivers/firmware/efi/Kconfig | 2 +- drivers/firmware/efi/libstub/Makefile | 13 +- drivers/firmware/efi/libstub/Makefile.zboot | 2 +- drivers/firmware/efi/libstub/efi-stub-helper.c | 3 + drivers/firmware/efi/libstub/x86-stub.c | 1 - drivers/firmware/efi/libstub/x86-zboot.c | 295 ++++++++++++++++++++ drivers/firmware/efi/libstub/zboot.c | 3 +- drivers/firmware/efi/libstub/zboot.lds | 5 + 12 files changed, 375 insertions(+), 12 deletions(-)
arch/x86/Makefile +13 -5
@@ -268,25 +268,33 @@ boot := arch/x86/boot BOOT_TARGETS = bzdisk fdimage fdimage144 fdimage288 hdimage isoimage -PHONY += bzImage $(BOOT_TARGETS) - -# Default kernel to build -all: bzImage +PHONY += bzImage vmlinuz.efi $(BOOT_TARGETS) # KBUILD_IMAGE specify target image being built +ifeq ($(CONFIG_EFI_ZBOOT),) KBUILD_IMAGE := $(boot)/bzImage +else +KBUILD_IMAGE := arch/x86/zboot/vmlinuz.efi +endif + +# Default kernel to build +all: $(notdir $(KBUILD_IMAGE)) bzImage: vmlinux ifeq ($(CONFIG_X86_DECODER_SELFTEST),y) $(Q)$(MAKE) $(build)=arch/x86/tools posttest endif - $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) + $(Q)$(MAKE) $(build)=$(boot) $(boot)/$(@) $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@ $(BOOT_TARGETS): vmlinux $(Q)$(MAKE) $(build)=$(boot) $@ +vmlinuz.efi: zboot := arch/x86/zboot +vmlinuz.efi: vmlinux + $(Q)$(MAKE) $(build)=$(zboot) $(zboot)/$@ + PHONY += install install: $(call cmd,install)
arch/x86/include/asm/efi.h +5 -0
@@ -471,4 +471,9 @@ static inline int efi_runtime_map_copy(void *buf, size_t bufsz)#endif +static inline unsigned long efi_get_kimg_min_align (void ) +{ +return SZ_2M ; +} +#endif /* _ASM_X86_EFI_H */
arch/x86/kernel/head_64.S +11 -0
@@ -64,6 +64,17 @@ SYM_CODE_START_NOALIGN(startup_64) /* Set up the stack for verify_cpu(), similar to initial_stack below */ leaq (__end_init_task - FRAME_SIZE)(%rip), %rsp +#ifdef CONFIG_EFI_ZBOOT + /* + * The generic EFI zboot code expects a __le32 at offset 0x10 of the + * decompressed image describing the size in memory of the kernel + * image. This is typically part of the image header, but we don't have + * such a header on x86 so just put the bare number here, encoded in a + * NOP instruction. + */ + .org startup_64 + 0x10 - 3, BYTES_NOP1 + nopl (_end - startup_64)(%rax) +#endif leaq _text(%rip), %rdi /*
arch/x86/zboot/Makefile new file +29 -0
@@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2023 Google LLC. <[email protected]> +# + +$(obj)/Image: OBJCOPYFLAGS := -O binary -S \ + -R .note -R .note.gnu.build-id -R .comment +$(obj)/Image: vmlinux FORCE + $(call if_changed,objcopy) + +CMD_RELOCS := arch/x86/tools/relocs + +quiet_cmd_relocs = RELOCS $@ + cmd_relocs = $(CMD_RELOCS) $< > $@ + +$(obj)/vmlinux.relocs: vmlinux FORCE + $(call if_changed,relocs) + +efi-zboot-relocs-$(CONFIG_X86_NEED_RELOCS) := $(obj)/vmlinux.relocs +EFI_ZBOOT_PAYLOAD_TRAILER := $(efi-zboot-relocs-y) + +EFI_ZBOOT_PAYLOAD := Image +EFI_ZBOOT_BFD_TARGET := elf64-x86-64 +EFI_ZBOOT_MACH_TYPE := AMD64 +EFI_ZBOOT_FORWARD_CFI := $(CONFIG_X86_KERNEL_IBT) + +targets := Image vmlinux.relocs + +include $(srctree)/drivers/firmware/efi/libstub/Makefile.zboot
drivers/firmware/efi/Kconfig +1 -1
@@ -74,7 +74,7 @@ config EFI_GENERIC_STUB config EFI_ZBOOT bool "Enable the generic EFI decompressor" - depends on EFI_GENERIC_STUB && !ARM + depends on (EFI_GENERIC_STUB && !ARM) || X86_64 select HAVE_KERNEL_GZIP select HAVE_KERNEL_LZ4 select HAVE_KERNEL_LZMA
drivers/firmware/efi/libstub/Makefile +10 -3
@@ -9,6 +9,9 @@ # non-x86 reuses KBUILD_CFLAGS, x86 does not cflags-y := $(KBUILD_CFLAGS) +cflags-x86-$(CONFIG_X86_KERNEL_IBT) := \ + $(call cc-option,-fcf-protection=branch -fno-jump-tables) + cflags-$(CONFIG_X86_32) := -march=i386 cflags-$(CONFIG_X86_64) := -mcmodel=small cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \
@@ -18,7 +21,7 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \ $(call cc-disable-warning, address-of-packed-member) \ $(call cc-disable-warning, gnu) \ -fno-asynchronous-unwind-tables \ - $(CLANG_FLAGS) + $(CLANG_FLAGS) $(cflags-x86-y) # arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly # disable the stackleak plugin
@@ -82,8 +85,8 @@ lib-$(CONFIG_EFI_PARAMS_FROM_FDT) += fdt.o \ $(obj)/lib-%.o: $(srctree)/lib/%.c FORCE $(call if_changed_rule,cc_o_c) -lib-$(CONFIG_EFI_GENERIC_STUB) += efi-stub.o string.o intrinsics.o systable.o \ - screen_info.o efi-stub-entry.o +lib-$(CONFIG_EFI_GENERIC_STUB) += efi-stub.o efi-stub-entry.o screen_info.o +lib-y += string.o intrinsics.o systable.o lib-$(CONFIG_ARM) += arm32-stub.o lib-$(CONFIG_ARM64) += arm64.o arm64-stub.o smbios.o
@@ -91,8 +94,12 @@ lib-$(CONFIG_X86) += x86.o x86-stub.o lib-$(CONFIG_RISCV) += riscv.o riscv-stub.o lib-$(CONFIG_LOONGARCH) += loongarch.o loongarch-stub.o +cflags-zboot-$(CONFIG_X86) := -Defi_zboot_entry=__efistub_efi_zboot_entry +CFLAGS_zboot.o := $(cflags-zboot-y) + CFLAGS_arm32-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET) +zboot-obj-$(CONFIG_X86_64) := x86-zboot.o zboot-obj-$(CONFIG_RISCV) := lib-clz_ctz.o lib-ashldi3.o lib-$(CONFIG_EFI_ZBOOT) += zboot.o $(zboot-obj-y)
drivers/firmware/efi/libstub/Makefile.zboot +1 -1
@@ -29,7 +29,7 @@ zboot-size-len-y := 4 zboot-method-$(CONFIG_KERNEL_GZIP) := gzip zboot-size-len-$(CONFIG_KERNEL_GZIP) := 0 -$(obj)/vmlinuz: $(obj)/vmlinux.bin FORCE +$(obj)/vmlinuz: $(obj)/vmlinux.bin $(EFI_ZBOOT_PAYLOAD_TRAILER) FORCE $(call if_changed,$(zboot-method-y)) OBJCOPYFLAGS_vmlinuz.o := -I binary -O $(EFI_ZBOOT_BFD_TARGET) \
drivers/firmware/efi/libstub/efi-stub-helper.c +3 -0
@@ -16,6 +16,7 @@#include "efistub.h" +bool efi_no5lvl;bool efi_nochunk;bool efi_nokaslr = !IS_ENABLED (CONFIG_RANDOMIZE_BASE );bool efi_novamap;
@@ -73,6 +74,8 @@ efi_status_t efi_parse_options(char const *cmdline) efi_loglevel =CONSOLE_LOGLEVEL_QUIET ; }else if (!strcmp (param,"noinitrd" )) { efi_noinitrd = true; + }else if (IS_ENABLED (CONFIG_X86_64 ) && !strcmp (param,"no5lvl" )) { + efi_no5lvl = true; }else if (!strcmp (param,"efi" ) && val) { efi_nochunk =parse_option_str (val,"nochunk" ); efi_novamap |=parse_option_str (val,"novamap" );
drivers/firmware/efi/libstub/x86-stub.c +0 -1
@@ -19,7 +19,6 @@/* Maximum physical address for 64-bit kernel with 4-level paging */ #define MAXMEM_X86_64_4LEVEL (1ull << 46) -const efi_system_table_t *efi_system_table;const efi_dxe_services_table_t *efi_dxe_table; u32 image_offset __section(".data");static efi_loaded_image_t *image =NULL ;
drivers/firmware/efi/libstub/x86-zboot.c new file +295 -0
295 lines not on this page · raw message
drivers/firmware/efi/libstub/zboot.c +2 -1
@@ -65,6 +65,7 @@ asmlinkage efi_status_t __efiapi efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab) { unsigned long compressed_size = _gzdata_end - _gzdata_start; +efi_guid_t loaded_image =LOADED_IMAGE_PROTOCOL_GUID ;unsigned long image_base, alloc_size;efi_loaded_image_t *image;efi_status_t status;
@@ -77,7 +78,7 @@ efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab) free_mem_end_ptr = free_mem_ptr +sizeof (zboot_heap); status =efi_bs_call (handle_protocol, handle, - &LOADED_IMAGE_PROTOCOL_GUID , (void **)&image); + &loaded_image, (void **)&image);if (status !=EFI_SUCCESS ) {error ("Failed to locate parent's loaded image protocol" );return status;
drivers/firmware/efi/libstub/zboot.lds +5 -0
@@ -14,8 +14,10 @@ SECTIONS .rodata : ALIGN(8) { __efistub__gzdata_start = .; + _gzdata_start = .; *(.gzdata) __efistub__gzdata_end = .; + _gzdata_end = .; *(.rodata* .init.rodata* .srodata*) _etext = ALIGN(4096); . = _etext;
@@ -35,11 +37,14 @@ SECTIONS /DISCARD/ : { *(.modinfo .init.modinfo) + *(.discard*) } } PROVIDE(__efistub__gzdata_size = ABSOLUTE(__efistub__gzdata_end - __efistub__gzdata_start)); +PROVIDE(_gzdata_size = __efistub__gzdata_size); + PROVIDE(__data_rawsize = ABSOLUTE(_edata - _etext)); PROVIDE(__data_size = ABSOLUTE(_end - _etext));
Signature · 1 line
2.39.2
Ard Biesheuvel
maintainerRFC PATCH 3/3 efi/zboot: x86: Clear NX restrictions on populated code regions
In reply to Ard BiesheuvelFuture EFI firmware will require the PE/COFF NX_COMPAT header flag to be set in order to retain access to all system facilities while features such as UEFI secure boot or TCG measured boot are enabled.
The consequence of setting this flag is that the EFI firmware image loader may configure the page allocator to set the NX attribute on all allocations requested by the image. This means we should clear this attribute on all regions we allocate and expect to be able to execute from.
In the x86 EFI zboot case, the only code we execute under EFI's 1:1 mapping that was not loaded by the image loader itself is the trampoline that effectuates the switch between 4 and 5 level paging, and the part of the loaded kernel image that runs before switching to its own page tables. So let's use the EFI memory attributes protocol to clear the NX attribute on these regions.
Whether or not setting the read-only attribute first is required is unclear at this point. Given that the kernel startup code uses two different executable sections before switching to its own page tables (normal text and inittext, with a writable data section in between), this would require some minor reorganization of the kernel memory map.
--- arch/x86/kernel/head_64.S | 4 +++ drivers/firmware/efi/libstub/x86-zboot.c | 27 ++++++++++++++++++++ 2 files changed, 31 insertions(+)
arch/x86/kernel/head_64.S +4 -0
@@ -74,6 +74,10 @@ SYM_CODE_START_NOALIGN(startup_64) */ .org startup_64 + 0x10 - 3, BYTES_NOP1 nopl (_end - startup_64)(%rax) + + /* put the size of the initial executable mapping at offset 0x20 */ + .org startup_64 + 0x20 - 3, BYTES_NOP1 + nopl (_einittext - startup_64)(%rax) #endif leaq _text(%rip), %rdi
drivers/firmware/efi/libstub/x86-zboot.c +27 -0
@@ -60,10 +60,33 @@ efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr)return status; } +static void efi_remap_exec (unsigned long base,unsigned long size) +{ +static efi_memory_attribute_protocol_t *memattr = (void *)ULONG_MAX ; +efi_guid_t guid =EFI_MEMORY_ATTRIBUTE_PROTOCOL_GUID ; +efi_status_t status; + +if (memattr == (void *)ULONG_MAX ) { + memattr =NULL ; + status =efi_bs_call (locate_protocol, &guid,NULL , + (void **)&memattr); +if (status !=EFI_SUCCESS ) +return ; + }else if (!memattr) { +return ; + } + + status = memattr->clear_memory_attributes (memattr, base, size, +EFI_MEMORY_XP ); +if (status !=EFI_SUCCESS ) +efi_warn ("Failed to clear NX attribute on code region\n" ); +} +void efi_cache_sync_image (unsigned long image_base,unsigned long alloc_size) {const u32 payload_size = *(u32 *)(_gzdata_end -4 );const u32 image_size = *(u32 *)(image_base +0x10 ); +const u32 code_size = *(u32 *)(image_base +0x20 );const s32 *reloc = (s32 *)(image_base + payload_size);u64 va_offset = __START_KERNEL - image_base;u64 range, delta;
@@ -107,6 +130,8 @@ void efi_cache_sync_image(unsigned long image_base, unsigned long alloc_size) *(u64 *)((s64)*reloc - va_offset) += delta;efi_free (alloc_size - image_size, image_base + image_size); + +efi_remap_exec (image_base,PAGE_ALIGN (code_size)); }static void __naked tmpl_toggle (void *cr3,void *gdt)
@@ -197,6 +222,8 @@ static efi_status_t efi_setup_5level_paging(void)*/ *(u32 *)&la57_code[tmpl_size -6 ] += (u64 )la57_code; +efi_remap_exec ((unsigned long )la57_code,PAGE_SIZE ); +return EFI_SUCCESS ; }
Signature · 1 line
2.39.2
Quoted 31 lines · Ard Biesheuvel
This series is a proof-of-concept that implements support for the EFI zboot decompressor for x86. It replaces the ordinary decompressor, and instead, performs the decompression, KASLR randomization and the 4/5 level paging switch while running in the execution context of EFI.
This simplifies things substantially, and makes it straight-forward to abide by stricter future requirements related to the use of writable and executable memory under EFI, which will come into effect on x86 systems that are certified as being 'more secure', and ship with an even shinier Windows sticker.
This is an alternative approach to the work being proposed by Evgeny [0] that makes rather radical changes to the existing decompressor, which has accumulated too many features already, e.g., related to confidential compute etc.
EFI zboot images can be booted in two ways:
- by EFI firmware, which loads and starts it as an ordinary EFI application, just like the existing EFI stub (with which it shares most of its code);
- by a non-EFI loader that parses the image header for the compression metadata, and decompresses the image into memory and boots it.Realistically, the second option is unlikely to ever be used on x86, given that it already has its existing bzImage, but the first option is a good choice for distros that target EFI boot only (and some distros switched to this format already for arm64). The fact that EFI zboot is implemented in the same way on arm64, RISC-V, LoongArch and [shortly] ARM helps with maintenance, not only of the kernel itself, but also the tooling around it relating to kexec, code signing, deployment, etc.
Quoted 2 lines
Series can be pulled from [1], which contains some prerequisite patches that are only tangentially related.
I've considered using similar approach when I was writing my series. That looks great if you look at subject without considering backwards compatibility, especially due to the increased code sharing and the usage of the code path without all the legacy stuff. But, I think, that zboot approach have two downsides:
* Most distros won't use it, due to backward compatibility, so they won't benefit the improvements.
* Those distros that would potentially use it, have to be either DIY-ish like Gentoo, or provide both kernels during installation. So it either complicates installation process or installer logic.
It might work for UEFI-only distros, but those won't be a majority for a little while for x86, I think. Because it's very likely that a lot of people will complain if distro provides zboot-only kernel (considering that the same story with the handover protocol). Backward compatibility is evil.
So, I think, at least for now, it would still be better to change existing extraction code and stay compatible, despite it being harder and less clean...
(zboot also lacks the support for some kernel options, like ones used for tweaking memory map; mixed mode support and probably the handling of CONFIG_MEMORY_HOTREMOVE, but that's an RFC, so this comment is largely irrelevant for now.)
Thanks,
Evgeniy Baskov
Quoted 45 lines
[0] https://lore.kernel.org/all/[email protected]/
[1] https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=efi-x86-zbootCc Evgeniy Baskov <[email protected]>Cc Borislav Petkov <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Dave Hansen <[email protected]>Cc Ingo Molnar <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Alexey Khoroshilov <[email protected]>Cc Peter Jones <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Dave Young <[email protected]>Cc Mario Limonciello <[email protected]>Cc Kees Cook <[email protected]>Cc Tom Lendacky <[email protected]>Cc Kirill A. Shutemov <[email protected]>Cc Linus Torvalds <[email protected]>Ard Biesheuvel (3):
efi/libstub: x86: Split off pieces shared with zboot efi/zboot: x86: Implement EFI zboot support efi/zboot: x86: Clear NX restrictions on populated code regionsarch/x86/Makefile | 18 +- arch/x86/include/asm/efi.h | 10 + arch/x86/kernel/head_64.S | 15 + arch/x86/zboot/Makefile | 29 + drivers/firmware/efi/Kconfig | 2 +- drivers/firmware/efi/libstub/Makefile | 15 +- drivers/firmware/efi/libstub/Makefile.zboot | 2 +- drivers/firmware/efi/libstub/efi-stub-helper.c | 3 + drivers/firmware/efi/libstub/x86-stub.c | 592 +------------------ drivers/firmware/efi/libstub/x86-zboot.c | 322 ++++++++++ drivers/firmware/efi/libstub/x86.c | 612 ++++++++++++++++++++ drivers/firmware/efi/libstub/zboot.c | 3 +- drivers/firmware/efi/libstub/zboot.lds | 5 + 13 files changed, 1031 insertions(+), 597 deletions(-) create mode 100644 arch/x86/zboot/Makefile create mode 100644 drivers/firmware/efi/libstub/x86-zboot.c create mode 100644 drivers/firmware/efi/libstub/x86.c
Hi,
[resend the reply since I mistakenly sent a html version, apologize for those who received two of this reply]
Quoted 23 lines · Ard Biesheuvel
This series is a proof-of-concept that implements support for the EFI zboot decompressor for x86. It replaces the ordinary decompressor, and instead, performs the decompression, KASLR randomization and the 4/5 level paging switch while running in the execution context of EFI.
This simplifies things substantially, and makes it straight-forward to abide by stricter future requirements related to the use of writable and executable memory under EFI, which will come into effect on x86 systems that are certified as being 'more secure', and ship with an even shinier Windows sticker.
This is an alternative approach to the work being proposed by Evgeny [0] that makes rather radical changes to the existing decompressor, which has accumulated too many features already, e.g., related to confidential compute etc.
EFI zboot images can be booted in two ways:
- by EFI firmware, which loads and starts it as an ordinary EFI application, just like the existing EFI stub (with which it shares most of its code);
- by a non-EFI loader that parses the image header for the compression metadata, and decompresses the image into memory and boots it.
Quoted 7 lines
Realistically, the second option is unlikely to ever be used on x86, given that it already has its existing bzImage, but the first option is a good choice for distros that target EFI boot only (and some distros switched to this format already for arm64). The fact that EFI zboot is implemented in the same way on arm64, RISC-V, LoongArch and [shortly] ARM helps with maintenance, not only of the kernel itself, but also the tooling around it relating to kexec, code signing, deployment, etc.
Hi Ard, since the kexec support is not yet ready, if no quick plan how about change the Kconfig and make zboot can be enabled only when kexec is not enabled.
Quoted 50 lines
Series can be pulled from [1], which contains some prerequisite patches that are only tangentially related.
[0] https://lore.kernel.org/all/[email protected]/
[1] https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=efi-x86-zbootCc Evgeniy Baskov <[email protected]>Cc Borislav Petkov <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Dave Hansen <[email protected]>Cc Ingo Molnar <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Alexey Khoroshilov <[email protected]>Cc Peter Jones <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Dave Young <[email protected]>Cc Mario Limonciello <[email protected]>Cc Kees Cook <[email protected]>Cc Tom Lendacky <[email protected]>Cc Kirill A. Shutemov <[email protected]>Cc Linus Torvalds <[email protected]>Ard Biesheuvel (3):
efi/libstub: x86: Split off pieces shared with zboot efi/zboot: x86: Implement EFI zboot support efi/zboot: x86: Clear NX restrictions on populated code regionsarch/x86/Makefile | 18 +- arch/x86/include/asm/efi.h | 10 + arch/x86/kernel/head_64.S | 15 + arch/x86/zboot/Makefile | 29 + drivers/firmware/efi/Kconfig | 2 +- drivers/firmware/efi/libstub/Makefile | 15 +- drivers/firmware/efi/libstub/Makefile.zboot | 2 +- drivers/firmware/efi/libstub/efi-stub-helper.c | 3 + drivers/firmware/efi/libstub/x86-stub.c | 592 +------------------ drivers/firmware/efi/libstub/x86-zboot.c | 322 ++++++++++ drivers/firmware/efi/libstub/x86.c | 612 ++++++++++++++++++++ drivers/firmware/efi/libstub/zboot.c | 3 +- drivers/firmware/efi/libstub/zboot.lds | 5 + 13 files changed, 1031 insertions(+), 597 deletions(-) create mode 100644 arch/x86/zboot/Makefile create mode 100644 drivers/firmware/efi/libstub/x86-zboot.c create mode 100644 drivers/firmware/efi/libstub/x86.cSignature · 1 line
2.39.2
Quoted 16 lines · Ard Biesheuvel
This series is a proof-of-concept that implements support for the EFI zboot decompressor for x86. It replaces the ordinary decompressor, and instead, performs the decompression, KASLR randomization and the 4/5 level paging switch while running in the execution context of EFI.
This simplifies things substantially, and makes it straight-forward to abide by stricter future requirements related to the use of writable and executable memory under EFI, which will come into effect on x86 systems that are certified as being 'more secure', and ship with an even shinier Windows sticker.
This is an alternative approach to the work being proposed by Evgeny [0] that makes rather radical changes to the existing decompressor, which has accumulated too many features already, e.g., related to confidential compute etc.
Quoted 6 lines
EFI zboot images can be booted in two ways:
- by EFI firmware, which loads and starts it as an ordinary EFI application, just like the existing EFI stub (with which it shares most of its code);
- by a non-EFI loader that parses the image header for the compression metadata, and decompresses the image into memory and boots it.
I like the idea to have all EFI archs handle compressed kernels the same way.
But given that going EFI-only on x86 isn't a realistic option for distros today this isn't really an alternative for Evgeny's patch series, we have to fix the existing bzImage decompressor too.
Quoted 1 line
Realistically, the second option is unlikely to ever be used on x86,
What would be needed to do so? Teach kexec-tools and grub2 parse and load zboot kernels I guess?
take care,
Gerd
Ard Biesheuvel
maintainerQuoted 25 lines · Gerd Hoffmann
Quoted 16 lines · Ard Biesheuvel
This series is a proof-of-concept that implements support for the EFI zboot decompressor for x86. It replaces the ordinary decompressor, and instead, performs the decompression, KASLR randomization and the 4/5 level paging switch while running in the execution context of EFI.
This simplifies things substantially, and makes it straight-forward to abide by stricter future requirements related to the use of writable and executable memory under EFI, which will come into effect on x86 systems that are certified as being 'more secure', and ship with an even shinier Windows sticker.
This is an alternative approach to the work being proposed by Evgeny [0] that makes rather radical changes to the existing decompressor, which has accumulated too many features already, e.g., related to confidential compute etc.
Quoted 6 lines
EFI zboot images can be booted in two ways:
- by EFI firmware, which loads and starts it as an ordinary EFI application, just like the existing EFI stub (with which it shares most of its code);
- by a non-EFI loader that parses the image header for the compression metadata, and decompresses the image into memory and boots it.
Quoted 7 lines
I like the idea to have all EFI archs handle compressed kernels the same way.
But given that going EFI-only on x86 isn't a realistic option for distros today this isn't really an alternative for Evgeny's patch series, we have to fix the existing bzImage decompressor too.
I tend to agree, although some clarification would be helpful regarding what is being fixed and why? I *think* I know, but I have not been involved as deeply as some of the distro folks in getting these requirements explicit.
Quoted 5 lines
Realistically, the second option is unlikely to ever be used on x86,
What would be needed to do so? Teach kexec-tools and grub2 parse and load zboot kernels I guess?
I already implemented this for mach-virt here, so we can load Fedora kernels without firmware:
https://gitlab.com/qemu-project/qemu/-/commit/ff11422804cd03494cc98691eecd3909ea09ab6f
On arm64, this is probably more straight-forward, as the bare metal image is already intended to be booted directly like that. However, the x86 uncompressed image requires surprisingly little from all the boot_params/setup_header cruft to actually boot, so perhaps there it is easy too.
There is an unresolved issue related to kexec_load_file(), where only the compressed image is signed, but the uncompressed image is what ultimately gets booted, which either needs the decompression to occur in the kernel, or a secondary signature that the kernel can verify after the decompression happens in user space.
Dave and I have generated several ideas here, but there hasn't been any progress towards a solution that seems palatable for upstream.
Hi,
Quoted 8 lines
Quoted 4 lines
Realistically, the second option is unlikely to ever be used on x86,
What would be needed to do so? Teach kexec-tools and grub2 parse and load zboot kernels I guess?
I already implemented this for mach-virt here, so we can load Fedora kernels without firmware:
Quoted 7 lines
https://gitlab.com/qemu-project/qemu/-/commit/ff11422804cd03494cc98691eecd3909ea09ab6f
On arm64, this is probably more straight-forward, as the bare metal image is already intended to be booted directly like that. However, the x86 uncompressed image requires surprisingly little from all the boot_params/setup_header cruft to actually boot, so perhaps there it is easy too.
For existing boot loaders like grub I'd expect it being easy to code up, all the setup header code exists already, grub also has support for uncompressing stuff, so it should really be only zboot header parsing and some plumbing to get things going (i.e. have grub boot efi zboot kernels in bios mode).
Disclaimer: didn't actually check grub source code.
I suspect the bigger problem wrt. grub is that getting patches merged upstream is extremely slow and every distro carries a huge stack of patches ...
take care,
Gerd
Ard Biesheuvel
maintainerQuoted 19 lines · Gerd Hoffmann
Hi,
Quoted 8 lines
Quoted 4 lines
Realistically, the second option is unlikely to ever be used on x86,
What would be needed to do so? Teach kexec-tools and grub2 parse and load zboot kernels I guess?
I already implemented this for mach-virt here, so we can load Fedora kernels without firmware:
Quoted 7 lines
https://gitlab.com/qemu-project/qemu/-/commit/ff11422804cd03494cc98691eecd3909ea09ab6f
On arm64, this is probably more straight-forward, as the bare metal image is already intended to be booted directly like that. However, the x86 uncompressed image requires surprisingly little from all the boot_params/setup_header cruft to actually boot, so perhaps there it is easy too.
Quoted 8 lines
For existing boot loaders like grub I'd expect it being easy to code up, all the setup header code exists already, grub also has support for uncompressing stuff, so it should really be only zboot header parsing and some plumbing to get things going (i.e. have grub boot efi zboot kernels in bios mode).
Disclaimer: didn't actually check grub source code.
I have :-(
Quoted 4 lines
I suspect the bigger problem wrt. grub is that getting patches merged upstream is extremely slow and every distro carries a huge stack of patches ...
Yeah, Daniel has been asking me about LoadFile2 initrd loading support for x86, so I think getting things merged is not going to be a problem (although it will still take some time) - I can just implement it and send it out at the same time.
But hacking/building/running GRUB is a rather painful experience, so I have been kicking this can down the road.
Quoted 27 lines · Ard Biesheuvel
Quoted 16 lines · Gerd Hoffmann
Hi,Quoted 7 lines
Quoted 4 lines
Realistically, the second option is unlikely to ever be used on x86,
What would be needed to do so? Teach kexec-tools and grub2 parse and load zboot kernels I guess?
I already implemented this for mach-virt here, so we can load Fedora kernels without firmware:
Quoted 7 lines
https://gitlab.com/qemu-project/qemu/-/commit/ff11422804cd03494cc98691eecd3909ea09ab6f
On arm64, this is probably more straight-forward, as the bare metal image is already intended to be booted directly like that. However, the x86 uncompressed image requires surprisingly little from all the boot_params/setup_header cruft to actually boot, so perhaps there it is easy too.
Quoted 8 lines
For existing boot loaders like grub I'd expect it being easy to code up, all the setup header code exists already, grub also has support for uncompressing stuff, so it should really be only zboot header parsing and some plumbing to get things going (i.e. have grub boot efi zboot kernels in bios mode).
Disclaimer: didn't actually check grub source code.
I have :-(
Quoted 8 lines
Quoted 4 lines
I suspect the bigger problem wrt. grub is that getting patches merged upstream is extremely slow and every distro carries a huge stack of patches ...
Yeah, Daniel has been asking me about LoadFile2 initrd loading support for x86, so I think getting things merged is not going to be a problem (although it will still take some time) - I can just implement it and send it out at the same time.
If zboot ends up being the way to go there would be quite a bit of pressure to land the GRUB stuff in distros because of the NX requirements being pushed into the EFI ecosystem.
They wouldn't be able to work on a system that enforces NX which is anticipated to balloon.
Quoted 3 lines
But hacking/building/running GRUB is a rather painful experience, so I have been kicking this can down the road.
Quoted 4 lines · Ard Biesheuvel
This series is a proof-of-concept that implements support for the EFI zboot decompressor for x86. It replaces the ordinary decompressor, and instead, performs the decompression, KASLR randomization and the 4/5 level paging switch while running in the execution context of EFI.
I like the concept. A couple high-level questions, since I haven’t dug into the code:
Could zboot and bzImage be built into the same kernel image? That would get this into distros, and eventually someone could modify the legacy path to switch to long mode and invoke zboot (because zboot surely doesn’t need actual UEFI — just a sensible environment like what UEFI provides.)
Does zboot set up BSS correctly? I once went down a rabbit hole trying to get the old decompressor to jump into the kernel with BSS already usable and zeroed, and the result was an incredible mess — IIRC the decompressor does some in-place shenanigans that looked incompatible with handling BSS without a rewrite. And so we clear BSS in C after jumping to the kernel, which is gross.
—Andy
Quoted 76 lines
This simplifies things substantially, and makes it straight-forward to abide by stricter future requirements related to the use of writable and executable memory under EFI, which will come into effect on x86 systems that are certified as being 'more secure', and ship with an even shinier Windows sticker.
This is an alternative approach to the work being proposed by Evgeny [0] that makes rather radical changes to the existing decompressor, which has accumulated too many features already, e.g., related to confidential compute etc.
EFI zboot images can be booted in two ways:
- by EFI firmware, which loads and starts it as an ordinary EFI application, just like the existing EFI stub (with which it shares most of its code);
- by a non-EFI loader that parses the image header for the compression metadata, and decompresses the image into memory and boots it.Realistically, the second option is unlikely to ever be used on x86, given that it already has its existing bzImage, but the first option is a good choice for distros that target EFI boot only (and some distros switched to this format already for arm64). The fact that EFI zboot is implemented in the same way on arm64, RISC-V, LoongArch and [shortly] ARM helps with maintenance, not only of the kernel itself, but also the tooling around it relating to kexec, code signing, deployment, etc.
Series can be pulled from [1], which contains some prerequisite patches that are only tangentially related.
[0] https://lore.kernel.org/all/[email protected]/
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=efi-x86-zbootCc Evgeniy Baskov <[email protected]>Cc Borislav Petkov <[email protected]>Cc Andy Lutomirski <[email protected]>Cc Dave Hansen <[email protected]>Cc Ingo Molnar <[email protected]>Cc Peter Zijlstra <[email protected]>Cc Thomas Gleixner <[email protected]>Cc Alexey Khoroshilov <[email protected]>Cc Peter Jones <[email protected]>Cc Gerd Hoffmann <[email protected]>Cc Dave Young <[email protected]>Cc Mario Limonciello <[email protected]>Cc Kees Cook <[email protected]>Cc Tom Lendacky <[email protected]>Cc Kirill A. Shutemov <[email protected]>Cc Linus Torvalds <[email protected]>Ard Biesheuvel (3):
efi/libstub: x86: Split off pieces shared with zboot efi/zboot: x86: Implement EFI zboot support efi/zboot: x86: Clear NX restrictions on populated code regionsarch/x86/Makefile | 18 +- arch/x86/include/asm/efi.h | 10 + arch/x86/kernel/head_64.S | 15 + arch/x86/zboot/Makefile | 29 + drivers/firmware/efi/Kconfig | 2 +- drivers/firmware/efi/libstub/Makefile | 15 +- drivers/firmware/efi/libstub/Makefile.zboot | 2 +- drivers/firmware/efi/libstub/efi-stub-helper.c | 3 + drivers/firmware/efi/libstub/x86-stub.c | 592 +------------------ drivers/firmware/efi/libstub/x86-zboot.c | 322 ++++++++++ drivers/firmware/efi/libstub/x86.c | 612 ++++++++++++++++++++ drivers/firmware/efi/libstub/zboot.c | 3 +- drivers/firmware/efi/libstub/zboot.lds | 5 + 13 files changed, 1031 insertions(+), 597 deletions(-) create mode 100644 arch/x86/zboot/Makefile create mode 100644 drivers/firmware/efi/libstub/x86-zboot.c create mode 100644 drivers/firmware/efi/libstub/x86.cSignature · 1 line
2.39.2
Ard Biesheuvel
maintainerQuoted 4 lines · Andy Lutomirski
On Sun, Apr 16, 2023, at 5:07 AM, Ard Biesheuvel wrote:
Quoted 9 lines
Quoted 4 lines
This series is a proof-of-concept that implements support for the EFI zboot decompressor for x86. It replaces the ordinary decompressor, and instead, performs the decompression, KASLR randomization and the 4/5 level paging switch while running in the execution context of EFI.
I like the concept. A couple high-level questions, since I haven’t dug into the code:
Could zboot and bzImage be built into the same kernel image? That would get this into distros, and eventually someone could modify the legacy path to switch to long mode and invoke zboot (because zboot surely doesn’t need actual UEFI — just a sensible environment like what UEFI provides.)
That's an interesting question, and to some extent, that is actually what Evgeny's patch does: execute more of what the decompressor does from inside the EFI runtime context.
The main win with zboot imho is that we get rid of all the funky heuristics that look for usable memory for trampolines and decompression buffers in funky ways, and instead, just use the EFI APIs for allocating pages and remapping them executable as needed (which is the important piece here) I'd have to think about whether there is any middle ground between this approach and Evgeny's - I'll have to get back to you on that.
Quoted 2 lines
Does zboot set up BSS correctly? I once went down a rabbit hole trying to get the old decompressor to jump into the kernel with BSS already usable and zeroed, and the result was an incredible mess — IIRC the decompressor does some in-place shenanigans that looked incompatible with handling BSS without a rewrite. And so we clear BSS in C after jumping to the kernel, which is gross.
Zboot pads the image to include BSS, so that the zboot metadata covers the actual memory footprint of the image rather than just the image size, and it will get zeroed out as a result of the decompression too, which is a nice bonus. I did this mainly to try and make it idiot proof for other (non-EFI) consumers of the zboot header and compressed payload, but it means that the zboot EFI loader doesn't have to bother either.
Quoted 19 lines · Ard Biesheuvel
Quoted 4 lines · Andy Lutomirski
On Sun, Apr 16, 2023, at 5:07 AM, Ard Biesheuvel wrote:
Quoted 9 lines
Quoted 4 lines
This series is a proof-of-concept that implements support for the EFI zboot decompressor for x86. It replaces the ordinary decompressor, and instead, performs the decompression, KASLR randomization and the 4/5 level paging switch while running in the execution context of EFI.
I like the concept. A couple high-level questions, since I haven’t dug into the code:
Could zboot and bzImage be built into the same kernel image? That would get this into distros, and eventually someone could modify the legacy path to switch to long mode and invoke zboot (because zboot surely doesn’t need actual UEFI — just a sensible environment like what UEFI provides.)
That's an interesting question, and to some extent, that is actually what Evgeny's patch does: execute more of what the decompressor does from inside the EFI runtime context.
Quoted 8 lines
The main win with zboot imho is that we get rid of all the funky heuristics that look for usable memory for trampolines and decompression buffers in funky ways, and instead, just use the EFI APIs for allocating pages and remapping them executable as needed (which is the important piece here) I'd have to think about whether there is any middle ground between this approach and Evgeny's - I'll have to get back to you on that.
Hmm. I dug the tiniest bit into the history. The x86/boot/compressed stuff has an allocator! It's this:
free_mem_ptr = heap; /* Heap */
free_mem_end_ptr = heap + BOOT_HEAP_SIZE;
plus a trivial and horrible malloc() implementation in include/linux/decompress/mm.h. There's one caller in x86/boot/compressed.
And, once upon a time, the idea of allocating enough memory to store the kernel from the decompressor would have been a problem. I'm willing to claim that we should not even try to support x86 systems that have that little memory (at least not once they've gotten long mode or at least flat 32-bit protected mode working). We should not try to allocate below 1MB (my laptop will cry), but there's no need for that.
So maybe the middle ground is to build a modern, simple malloc(), and back it by EFI when EFI is there and by just finding some free memory when EFI is not there?
This would be risky -- someone might have a horrible machine that has trouble with a simple allocator.
Ard Biesheuvel
maintainerQuoted 35 lines · Andy Lutomirski
Quoted 19 lines · Ard Biesheuvel
Quoted 4 lines · Andy Lutomirski
On Sun, Apr 16, 2023, at 5:07 AM, Ard Biesheuvel wrote:
Quoted 9 lines
Quoted 4 lines
This series is a proof-of-concept that implements support for the EFI zboot decompressor for x86. It replaces the ordinary decompressor, and instead, performs the decompression, KASLR randomization and the 4/5 level paging switch while running in the execution context of EFI.
I like the concept. A couple high-level questions, since I haven’t dug into the code:
Could zboot and bzImage be built into the same kernel image? That would get this into distros, and eventually someone could modify the legacy path to switch to long mode and invoke zboot (because zboot surely doesn’t need actual UEFI — just a sensible environment like what UEFI provides.)
That's an interesting question, and to some extent, that is actually what Evgeny's patch does: execute more of what the decompressor does from inside the EFI runtime context.
Quoted 8 lines
The main win with zboot imho is that we get rid of all the funky heuristics that look for usable memory for trampolines and decompression buffers in funky ways, and instead, just use the EFI APIs for allocating pages and remapping them executable as needed (which is the important piece here) I'd have to think about whether there is any middle ground between this approach and Evgeny's - I'll have to get back to you on that.
Hmm. I dug the tiniest bit into the history. The x86/boot/compressed stuff has an allocator! It's this:
free_mem_ptr= heap; /* Heap */
free_mem_end_ptr= heap +BOOT_HEAP_SIZE;
Quoted 7 lines
plus a trivial and horrible
malloc()implementation ininclude/linux/decompress/mm.h. There's one caller in x86/boot/compressed.And, once upon a time, the idea of allocating enough memory to store the kernel from the decompressor would have been a problem. I'm willing to claim that we should not even try to support x86 systems that have that little memory (at least not once they've gotten long mode or at least flat 32-bit protected mode working). We should not try to allocate below 1MB (my laptop will cry), but there's no need for that.
So maybe the middle ground is to build a modern, simple
malloc(), and back it by EFI when EFI is there and by just finding some free memory when EFI is not there?This would be risky -- someone might have a horrible machine that has trouble with a simple allocator.
The malloc() is the least or our concerns, tbh. It is only used by the decompression library itself, and it is backed by a statically allocated block of BSS.
Having just gone through this again, the main issues are:
1) The 4/5 level switching trampoline, which runs in the page tables of the loader/EFI stub, and assumes that it is fine to grab a random chunk of low memory, stash its contents somewhere, use it for some code, a stack and a root level page table so we can do the x86 long mode paging off/paging on salsa, and then copy back the contents and carry on as if nothing happened. We currently have some code in the stub that strips all NX restrictions from a generously overdimensioned block of low memory so copying and running code like this actually works.
2) We need an accurate description in the PE/COFF header of what needs to be executable and what needs to be writable, so we can splt the regions. This only matters for code that runs under EFI's mappings, so not a lot.
3) The payload relocates itself to the end of the decompression buffer so it doesn't overwrite itself before completing. This is fragile and also unnecessary when there is a page allocator and plenty of memory, but afaict, this all executes under the decompressor's own page tables so the RO/NX attributes that EFI sets are not a concern here. It would, of course, be nice if we could avoid relying on RWX mappings here.
4) I think it was you who pointed out that the demand paging 1:1 map should really only get triggered for data accesses and not code accesses, so it would be nice if we could create such mappings with NX attributes.
I've had another go at running the decompressed kernel directly, without going through the decompressor logic at all, but I missed the fact that SEV does a substantial amount of work in the decompressor too, so I'm no longer convinced that this is a viable approach. But I'm looking into this.
I just finished some patches [0] that only address 1), based on the work I posted earlier. I'll send those out once -rc1 comes around.
[0] https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/log/?h=efi-x86-cleanup-la57