Skip to content

efi: Implement generic EFI boot for x86

Ard Biesheuvel grub-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 23 repliesIn review
  2. v35 patches 1 replySuperseded
  3. v26 patches 19 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v15 patches4 repliesSuperseded

Changes in v4 from the cover letter

- add missing efiapi annotations to efiemu routines
- work around dead code warning from Coverity by making unnecessary changes to the initrd loading logic in the generic EFI loader

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5efi: Make EFI PXE protocol methods non-callableinclude/grub/efi/api.h+12 -120 replies
2/5efi: Add calling convention annotation to all prototypesgrub-core/efiemu/runtime/efiemu.c grub-core/kern/arm/efi/init.c include/grub/efi/api.h +1 more+397 -3710 replies
3/5efi: Drop all uses of efi_call_XX wrappersgrub-core/commands/acpi.c grub-core/commands/efi/efitextmode.c grub-core/commands/efi/lsefi.c +20 more+165 -17012 replies
4/5efi: Remove x86_64 call wrappersgrub-core/Makefile.core.def grub-core/kern/x86_64/efi/callwrap.S include/grub/efi/api.h+0 -2030 replies
5/5efi: Use generic EFI loader for x86_64 and i386grub-core/Makefile.core.def grub-core/loader/efi/linux.c grub-core/loader/i386/linux.c +1 more+54 -510 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/5] efi: Implement generic EFI boot for x86

Switch the i386-efi and x86_64-efi builds to the generic EFI loader, which enters the Linux kernel via the EFI stub and provides the initrd via the LoadFile2 protocol. This unifies x86 with other EFI architectures, and removes the dependency on the setup header and struct bootparams.

Do some preparatory cleanup first, so we no longer need to rely on the MS to SysV calling convention translation code.

Changes since v3:
- add missing efiapi annotations to efiemu routines
- work around dead code warning from Coverity by making unnecessary changes to the initrd loading logic in the generic EFI loader

Changes since v2:
- rebase onto latest master, which has the Loongarch changes
- retain Itanium support for now
- simplify the fallback logic - attempt to load the image as usual, and fallback on failure or if the image does not implement LoadFile2

Changes since v1:
- drop Itanium support, which is a maintenance burden as it shares the EFI code with other architectures, but does not have a EFI stub in Linux, and there is no way to test whether our changes break the boot for it or not;
- enable generic EFI for i386 as well
- wire up the existing x86 code as a fallback for kernels that lack EFI stub or LoadFile2 support. This removes the need for additional changes to support v5.8 or older kernels.

Cc Daniel Kiper <[email protected]>
Cc Glenn Washburn <[email protected]>

Ard Biesheuvel (5):
efi: Make EFI PXE protocol methods non-callable
efi: Add calling convention annotation to all prototypes
efi: Drop all uses of efi_call_XX wrappers
efi: Remove x86_64 call wrappers
efi: Use generic EFI loader for x86_64 and i386

 grub-core/Makefile.core.def           |   3 +-
 grub-core/commands/acpi.c             |   8 +-
 grub-core/commands/efi/efitextmode.c  |   8 +-
 grub-core/commands/efi/lsefi.c        |   5 +-
 grub-core/commands/efi/tpm.c          |  21 +-
 grub-core/disk/efi/efidisk.c          |   7 +-
 grub-core/efiemu/runtime/efiemu.c     |  48 +-
 grub-core/kern/arm/efi/init.c         |  12 +-
 grub-core/kern/efi/efi.c              |  56 +-
 grub-core/kern/efi/init.c             |  15 +-
 grub-core/kern/efi/mm.c               |  17 +-
 grub-core/kern/i386/efi/tsc.c         |   2 +-
 grub-core/kern/ia64/efi/init.c        |  14 +-
 grub-core/kern/loongarch64/efi/init.c |  10 +-
 grub-core/kern/x86_64/efi/callwrap.S  | 129 ----
 grub-core/lib/efi/datetime.c          |   9 +-
 grub-core/lib/efi/halt.c              |   4 +-
 grub-core/lib/efi/relocator.c         |   6 +-
 grub-core/loader/efi/appleloader.c    |   8 +-
 grub-core/loader/efi/chainloader.c    |  20 +-
 grub-core/loader/efi/linux.c          |  47 +-
 grub-core/loader/i386/linux.c         |   8 +
 grub-core/mmap/efi/mmap.c             |  16 +-
 grub-core/net/drivers/efi/efinet.c    |  26 +-
 grub-core/term/efi/console.c          |  29 +-
 grub-core/term/efi/serial.c           |  18 +-
 grub-core/video/efi_gop.c             |  18 +-
 grub-core/video/efi_uga.c             |   8 +-
 include/grub/efi/api.h                | 666 +++++++++-----------
 include/grub/efi/efi.h                |   2 +-
 include/grub/efi/tpm.h                | 149 +++--
 31 files changed, 628 insertions(+), 761 deletions(-)
 delete mode 100644 grub-core/kern/x86_64/efi/callwrap.S
Signature · 1 line
2.39.2