Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:michael-chang:test:grub:old
grub2
0016-efi-allocate-the-initrd-within-the-bounds-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0016-efi-allocate-the-initrd-within-the-bounds-expressed-.patch of Package grub2
From 08db0605ad421bf632206f77f2debd0c706e5779 Mon Sep 17 00:00:00 2001 From: Peter Jones <pjones@redhat.com> Date: Mon, 1 Aug 2022 14:07:50 -0400 Subject: [PATCH 16/26] efi: allocate the initrd within the bounds expressed by the kernel Currently on x86, only linux kernels built with CONFIG_RELOCATABLE for x86_64 can be loaded above 4G, but the maximum address for the initramfs is specified via a HdrS field. This allows us to utilize that value, and unless loading the kernel above 4G, uses the value present there. If loading kernel above 4G is allowed, we assume loading the initramfs above 4G also works; in practice this has been true in the kernel code for quite some time. Resolves: rhbz#2112134 Signed-off-by: Peter Jones <pjones@redhat.com> --- grub-core/loader/i386/efi/linux.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c index 342b07aa6..cc4a0b615 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -191,6 +191,8 @@ grub_linuxefi_unload (void *data) cmd_initrdefi->data = 0; grub_free (context); + max_addresses[INITRD_MAX_ADDRESS].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS; + return GRUB_ERR_NONE; } @@ -359,11 +361,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } #endif + max_addresses[INITRD_MAX_ADDRESS].addr = lh->initrd_addr_max; #if defined(__x86_64__) if (lh->xloadflags & LINUX_XLF_CAN_BE_LOADED_ABOVE_4G) { grub_dprintf ("linux", "Loading kernel above 4GB is supported; enabling.\n"); max_addresses[KERNEL_NO_LIMIT].addr = GRUB_EFI_MAX_USABLE_ADDRESS; + max_addresses[INITRD_MAX_ADDRESS].addr = GRUB_EFI_MAX_USABLE_ADDRESS; } else { @@ -492,6 +496,8 @@ fail: grub_dl_unref (my_mod); + max_addresses[INITRD_MAX_ADDRESS].addr = GRUB_EFI_MAX_ALLOCATION_ADDRESS; + if (lh) kernel_free (cmdline, lh->cmdline_size + 1); -- 2.42.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor