[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386
From: |
Ard Biesheuvel |
Subject: |
Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386 |
Date: |
Tue, 23 May 2023 17:34:38 +0200 |
On Tue, 23 May 2023 at 17:32, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> Switch the x86 based EFI platform builds 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.
>
> Given that only Linux kernel versions v5.8 and later support this initrd
> loading method, the existing x86 loader is retained as a fallback, which
> will also be used for Linux kernels built without the EFI stub. In this
> case, GRUB calls ExitBootServices() before entering the Linux kernel,
> and all EFI related information is provided to the kernel via struct
> boot_params in the setup header, as before.
>
> Note that this means that booting EFI stub kernels older than v5.8 is
> not supported even when not using an initrd at all. Also, the EFI
> handover protocol, which has no basis in the UEFI specification, is not
> implemented.
>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This patch needs the hunk below, which i failed to git add - apologies
--- a/grub-core/loader/efi/linux.c
+++ b/grub-core/loader/efi/linux.c
@@ -360,7 +360,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__
((unused)),
int argc, char *argv[])
{
int __attribute__ ((unused)) initrd_size, initrd_pages;
- void *initrd_mem = NULL;
+ void *__attribute__ ((unused)) initrd_mem = NULL;
grub_efi_boot_services_t *b = grub_efi_system_table->boot_services;
grub_efi_status_t status;
- [PATCH v4 0/5] efi: Implement generic EFI boot for x86, Ard Biesheuvel, 2023/05/23
- [PATCH v4 2/5] efi: Add calling convention annotation to all prototypes, Ard Biesheuvel, 2023/05/23
- [PATCH v4 4/5] efi: Remove x86_64 call wrappers, Ard Biesheuvel, 2023/05/23
- [PATCH v4 1/5] efi: Make EFI PXE protocol methods non-callable, Ard Biesheuvel, 2023/05/23
- [PATCH v4 3/5] efi: Drop all uses of efi_call_XX wrappers, Ard Biesheuvel, 2023/05/23
- [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386, Ard Biesheuvel, 2023/05/23
- Re: [PATCH v4 5/5] efi: Use generic EFI loader for x86_64 and i386,
Ard Biesheuvel <=
- Re: [PATCH v4 0/5] efi: Implement generic EFI boot for x86, Daniel Kiper, 2023/05/24