All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@arm.com>
To: linux-efi@vger.kernel.org
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>,
	grub-devel@gnu.org, daniel.kiper@oracle.com, leif@nuviainc.com
Subject: [PATCH v2 0/8] linux: implement LoadFile2 initrd loading
Date: Sun, 25 Oct 2020 14:49:33 +0100	[thread overview]
Message-ID: <20201025134941.4805-1-ard.biesheuvel@arm.com> (raw)

This implements the LoadFile2 initrd loading protocol, which is
essentially a callback face into the bootloader to load the initrd
data into a caller provided buffer. This means the bootloader no
longer has to contain any policy regarding where to load the initrd
(which differs between architectures and kernel versions) and no
longer has to manipulate arch specific data structures such as DT
or struct bootparams to inform the OS where the initrd resides in
memory.

Sample output from booting a recent Linux/arm64 kernel:

  grub> insmod part_msdos
  grub> linux (hd0,msdos1)/Image
  grub> initrd (hd0,msdos1)/initrd.img
  grub> boot
  EFI stub: Booting Linux Kernel...
  EFI stub: EFI_RNG_PROTOCOL unavailable, KASLR will be disabled
  EFI stub: Generating empty DTB
  EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
  EFI stub: Exiting boot services and installing virtual address map...
  [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]

Cc: grub-devel@gnu.org
Cc: daniel.kiper@oracle.com
Cc: leif@nuviainc.com

Changes since v1:
- add Leif's ack to #2, #6 and #8
- add patch #1 to fix the ARM Linux image header definition
- add patches #3, #4 and #5 to unify and reuse the COFF header loading routines
  from Xen (and the absence of which from v1 was causing garbage to be read and
  interpreted as the image major version)

Ard Biesheuvel (8):
  linux/arm: fix ARM Linux header layout
  loader/linux: permit NULL argument for argv[] in grub_initrd_load()
  efi: move MS-DOS stub out of generic PE header definition
  linux/arm: unify ARM/arm64 vs Xen PE/COFF header handling
  linux/arm: account for COFF headers appearing at unexpected offsets
  efi: add definition of LoadFile2 protocol
  efi: implement LoadFile2 initrd loading protocol for Linux
  linux: ignore FDT unless we need to modify it

 grub-core/commands/efi/lsefi.c    |   1 +
 grub-core/kern/efi/efi.c          |   5 +-
 grub-core/loader/arm64/linux.c    | 158 +++++++++++++++++---
 grub-core/loader/arm64/xen_boot.c |  23 +--
 grub-core/loader/efi/fdt.c        |   7 +-
 grub-core/loader/linux.c          |   2 +-
 include/grub/arm/linux.h          |   8 +-
 include/grub/arm64/linux.h        |   4 +
 include/grub/efi/api.h            |  15 ++
 include/grub/efi/efi.h            |   4 +-
 include/grub/efi/pe32.h           |   5 +-
 11 files changed, 185 insertions(+), 47 deletions(-)

-- 
2.17.1


             reply	other threads:[~2020-10-25 13:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-25 13:49 Ard Biesheuvel [this message]
2020-10-25 13:49 ` [PATCH v2 1/8] linux/arm: fix ARM Linux header layout Ard Biesheuvel
2020-11-04 12:11   ` Leif Lindholm
2020-11-04 12:19     ` Ard Biesheuvel
2020-11-04 12:31       ` Leif Lindholm
2021-03-11 16:18   ` Daniel Kiper
2020-10-25 13:49 ` [PATCH v2 2/8] loader/linux: permit NULL argument for argv[] in grub_initrd_load() Ard Biesheuvel
2020-10-25 13:49 ` [PATCH v2 3/8] efi: move MS-DOS stub out of generic PE header definition Ard Biesheuvel
2021-04-08 18:44   ` Heinrich Schuchardt
2021-04-09  6:10     ` Ard Biesheuvel
2021-04-09  6:29       ` Heinrich Schuchardt
2020-10-25 13:49 ` [PATCH v2 4/8] linux/arm: unify ARM/arm64 vs Xen PE/COFF header handling Ard Biesheuvel
2020-10-25 13:49 ` [PATCH v2 5/8] linux/arm: account for COFF headers appearing at unexpected offsets Ard Biesheuvel
2021-04-08 18:56   ` Heinrich Schuchardt
2021-04-09  6:12     ` Ard Biesheuvel
2021-04-09  6:40       ` Heinrich Schuchardt
2021-04-09  6:58         ` Ard Biesheuvel
2020-10-25 13:49 ` [PATCH v2 6/8] efi: add definition of LoadFile2 protocol Ard Biesheuvel
2020-10-25 13:49 ` [PATCH v2 7/8] efi: implement LoadFile2 initrd loading protocol for Linux Ard Biesheuvel
2020-10-26 21:37   ` Atish Patra
2020-10-26 22:00     ` Ard Biesheuvel
2020-10-25 13:49 ` [PATCH v2 8/8] linux: ignore FDT unless we need to modify it 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=20201025134941.4805-1-ard.biesheuvel@arm.com \
    --to=ard.biesheuvel@arm.com \
    --cc=daniel.kiper@oracle.com \
    --cc=grub-devel@gnu.org \
    --cc=leif@nuviainc.com \
    --cc=linux-efi@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.