Blame SOURCES/0266-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch

fd0330
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
fd0330
From: Peter Jones <pjones@redhat.com>
fd0330
Date: Mon, 1 Aug 2022 13:04:43 -0400
fd0330
Subject: [PATCH] efi: use EFI_LOADER_(CODE|DATA) for kernel and initrd
fd0330
 allocations
fd0330
fd0330
At some point due to an erroneous kernel warning, we switched kernel and
fd0330
initramfs to being loaded in EFI_RUNTIME_SERVICES_CODE and
fd0330
EFI_RUNTIME_SERVICES_DATA memory pools.  This doesn't appear to be
fd0330
correct according to the spec, and that kernel warning has gone away.
fd0330
fd0330
This patch puts them back in EFI_LOADER_CODE and EFI_LOADER_DATA
fd0330
allocations, respectively.
fd0330
fd0330
Resolves: rhbz#2108456
fd0330
fd0330
Signed-off-by: Peter Jones <pjones@redhat.com>
fd0330
---
fd0330
 grub-core/loader/i386/efi/linux.c | 8 ++++----
fd0330
 1 file changed, 4 insertions(+), 4 deletions(-)
fd0330
fd0330
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
fd0330
index d003b474ee..ac5ef50bdb 100644
fd0330
--- a/grub-core/loader/i386/efi/linux.c
fd0330
+++ b/grub-core/loader/i386/efi/linux.c
fd0330
@@ -279,7 +279,7 @@ grub_cmd_initrd (grub_command_t cmd, int argc, char *argv[])
fd0330
     }
fd0330
 
fd0330
   grub_dprintf ("linux", "Trying to allocate initrd mem\n");
fd0330
-  initrd_mem = kernel_alloc(INITRD_MEM, size, GRUB_EFI_RUNTIME_SERVICES_DATA,
fd0330
+  initrd_mem = kernel_alloc(INITRD_MEM, size, GRUB_EFI_LOADER_DATA,
fd0330
 			    N_("can't allocate initrd"));
fd0330
   if (initrd_mem == NULL)
fd0330
     goto fail;
fd0330
@@ -443,7 +443,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
fd0330
 #endif
fd0330
 
fd0330
   params = kernel_alloc (KERNEL_MEM, sizeof(*params),
fd0330
-			 GRUB_EFI_RUNTIME_SERVICES_DATA,
fd0330
+			 GRUB_EFI_LOADER_DATA,
fd0330
 			 "cannot allocate kernel parameters");
fd0330
   if (!params)
fd0330
     goto fail;
fd0330
@@ -467,7 +467,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
fd0330
 
fd0330
   grub_dprintf ("linux", "setting up cmdline\n");
fd0330
   cmdline = kernel_alloc (KERNEL_MEM, lh->cmdline_size + 1,
fd0330
-			  GRUB_EFI_RUNTIME_SERVICES_DATA,
fd0330
+			  GRUB_EFI_LOADER_DATA,
fd0330
 			  N_("can't allocate cmdline"));
fd0330
   if (!cmdline)
fd0330
     goto fail;
fd0330
@@ -516,7 +516,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
fd0330
   kernel_size = lh->init_size;
fd0330
   grub_dprintf ("linux", "Trying to allocate kernel mem\n");
fd0330
   kernel_mem = kernel_alloc (KERNEL_MEM, kernel_size,
fd0330
-			     GRUB_EFI_RUNTIME_SERVICES_CODE,
fd0330
+			     GRUB_EFI_LOADER_CODE,
fd0330
 			     N_("can't allocate kernel"));
fd0330
   restore_addresses();
fd0330
   if (!kernel_mem)