]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
efi: The device-tree must be in EfiACPIReclaimMemory
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 29 Jan 2021 15:32:29 +0000 (16:32 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 16:39:42 +0000 (17:39 +0100)
According to the Embedded Base Boot Requirements (EBBR) specification the
device-tree passed to Linux as a configuration table must reside in
EfiACPIReclaimMemory.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/efi/fdt.c

index 003d07cd86d362409e16fc2139179a341c1ad699..c86f283d756b2bd9a375bd1f9a47affbbbd01241 100644 (file)
@@ -25,6 +25,7 @@
 #include <grub/efi/efi.h>
 #include <grub/efi/fdtload.h>
 #include <grub/efi/memory.h>
+#include <grub/cpu/efi/memory.h>
 
 static void *loaded_fdt;
 static void *fdt;
@@ -60,7 +61,10 @@ grub_fdt_load (grub_size_t additional_size)
   size += additional_size;
 
   grub_dprintf ("linux", "allocating %d bytes for fdt\n", size);
-  fdt = grub_efi_allocate_any_pages (GRUB_EFI_BYTES_TO_PAGES (size));
+  fdt = grub_efi_allocate_pages_real (GRUB_EFI_MAX_USABLE_ADDRESS,
+                                     GRUB_EFI_BYTES_TO_PAGES (size),
+                                     GRUB_EFI_ALLOCATE_MAX_ADDRESS,
+                                     GRUB_EFI_ACPI_RECLAIM_MEMORY);
   if (!fdt)
     return NULL;