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

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