[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/5] efi: Use generic EFI loader for x86_64
From: |
Ard Biesheuvel |
Subject: |
Re: [PATCH 5/5] efi: Use generic EFI loader for x86_64 |
Date: |
Thu, 11 May 2023 10:15:51 +0200 |
On Wed, 10 May 2023 at 19:40, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Wed, 10 May 2023 at 15:15, Daniel Kiper <dkiper@net-space.pl> wrote:
> >
> > On Wed, May 10, 2023 at 12:40:30PM +0200, Ard Biesheuvel wrote:
> > > On Tue, 9 May 2023 at 18:53, Ard Biesheuvel <ardb@kernel.org> wrote:
> > > >
> > > > Switch the x86_64 build to the generic EFI loader, which exposes the
> > > > initrd via the LoadFile2 protocol instead of the x86-specific setup
> > > > header. This will launch the Linux kernel via its EFI stub, which
> > > > performs its own initialization in the EFI boot services context before
> > > > calling ExitBootServices() and performing the bare metal Linux boot.
> > > >
> > > > Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> > > > ---
> > > > grub-core/Makefile.core.def | 6 +-----
> > > > grub-core/kern/efi/mm.c | 2 +-
> > > > grub-core/loader/efi/linux.c | 12 ++++++++++++
> > > > include/grub/efi/efi.h | 2 ++
> > > > 4 files changed, 16 insertions(+), 6 deletions(-)
> > > >
> > > > diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
> > > > index c17d022195b3fdca..f9e89a0cc4389dd0 100644
> > > > --- a/grub-core/Makefile.core.def
> > > > +++ b/grub-core/Makefile.core.def
> > > > @@ -1822,7 +1822,6 @@ module = {
> > > >
> > > > module = {
> > > > name = linux;
> > > > - x86 = loader/i386/linux.c;
> > > > i386_xen_pvh = loader/i386/linux.c;
> > > > xen = loader/i386/xen.c;
> > > > i386_pc = lib/i386/pc/vesa_modes_table.c;
> > > > @@ -1832,11 +1831,8 @@ module = {
> > > > sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
> > > > ia64_efi = loader/ia64/efi/linux.c;
> > > > arm_coreboot = loader/arm/linux.c;
> > > > - arm_efi = loader/efi/linux.c;
> > > > + efi = loader/efi/linux.c;
> > >
> > > This change breaks the build for i386_efi. Any suggestions on how to
> > > rephrase this?
>
> Also, I think the command line piece is missing - I'll fix that up for v2.
>
Never mind - I was looking at distro GRUB, which looks quite different :-)
I'll replace this hunk with
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -1809,7 +1809,7 @@ module = {
module = {
name = linux;
- x86 = loader/i386/linux.c;
+ i386 = loader/i386/linux.c;
i386_xen_pvh = loader/i386/linux.c;
xen = loader/i386/xen.c;
i386_pc = lib/i386/pc/vesa_modes_table.c;
@@ -1823,6 +1823,7 @@ module = {
arm64 = loader/efi/linux.c;
riscv32 = loader/efi/linux.c;
riscv64 = loader/efi/linux.c;
+ x86_64_efi = loader/efi/linux.c;
emu = loader/emu/linux.c;
common = loader/linux.c;
common = lib/cmdline.c;
and we can always consolidate it later if we figure out how
[PATCH 4/5] efi: Remove x86_64 call wrappers, Ard Biesheuvel, 2023/05/09
[PATCH 2/5] efi: Add calling convention annotation to all prototypes, Ard Biesheuvel, 2023/05/09
[PATCH 3/5] efi: Drop all uses of efi_call_XX wrappers, Ard Biesheuvel, 2023/05/09