public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] efi: Add generic magic number in header
@ 2022-11-29 17:56 Ard Biesheuvel
  2022-11-29 17:56 ` [PATCH v2 1/2] efi: libstub: Always enable initrd command line loader and bump version Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ard Biesheuvel @ 2022-11-29 17:56 UTC (permalink / raw)
  To: linux-efi
  Cc: grub-devel, Ard Biesheuvel, Huacai Chen, Atish Patra,
	Heinrich Schuchardt, Daniel Kiper, Leif Lindholm

This is a minimal respin of the RFC patch I sent out a few week ago. No
changes were applied except the /0x30/0x38 typo fix and some additional
wording in the commit log. I also added a patch to make the command line
initrd loader always built-in.

The purpose of all of this is to create *and document* a common baseline
for EFI booting of Linux. (I know I promised some documentation myself,
but I simply don't have time for that, so if anyone feels so inclined,
please go ahead).

The idea is that EFI images with the LINUX_PE_MAGIC number are
guaranteed to support:
- initrd loading via LoadFile2
- initrd loading via the command line
- (on x86) mixed mode boot via the .compat entry point
- other things I missed?

Architectures such as arm64 and RISC-V already have their own magic
numbers, in which case the PE/COFF major/minor image version should be
inspected, where 1.1 corresponds with the set described above.

If other architectures want to create hybrid images as well, it would be
better to use a different offset to store the magic number, so that the
generic EFI one can be carried as well. The reason for deviating from
this for arm64 and RISC-V is the simple fact that existing images
already exist, so for those architectures, we have to consider both
anyway.

Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Atish Patra <atishp@rivosinc.com>
Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>

Ard Biesheuvel (2):
  efi: libstub: Always enable initrd command line loader and bump
    version
  efi: Put Linux specific magic number in the DOS header

 arch/loongarch/kernel/head.S                   |  3 ++-
 arch/x86/boot/header.S                         |  3 ++-
 drivers/firmware/efi/Kconfig                   | 15 ---------------
 drivers/firmware/efi/libstub/efi-stub-helper.c |  3 +--
 drivers/firmware/efi/libstub/zboot-header.S    |  3 ++-
 include/linux/pe.h                             |  9 ++++++++-
 6 files changed, 15 insertions(+), 21 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-12-07 14:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-29 17:56 [PATCH v2 0/2] efi: Add generic magic number in header Ard Biesheuvel
2022-11-29 17:56 ` [PATCH v2 1/2] efi: libstub: Always enable initrd command line loader and bump version Ard Biesheuvel
2022-11-29 17:56 ` [PATCH v2 2/2] efi: Put Linux specific magic number in the DOS header Ard Biesheuvel
2022-12-01 14:29   ` Daniel Kiper
2022-12-01 14:48     ` Ard Biesheuvel
2022-12-01 14:58       ` Daniel Kiper
2022-12-01 19:25       ` Daniel Kiper
2022-12-06  9:52     ` Atish Patra
2022-12-07  7:51   ` Xiaotian Wu
2022-12-07  8:06     ` Ard Biesheuvel
2022-12-07 10:35       ` Xiaotian Wu
2022-12-07 14:06         ` Ard Biesheuvel
2022-11-29 19:58 ` [PATCH v2 0/2] efi: Add generic magic number in header Leif Lindholm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox