]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
arm64/efi: Fix grub_efi_get_ram_base()
authorLeif Lindholm <leif.lindholm@linaro.org>
Thu, 21 Feb 2019 10:15:08 +0000 (10:15 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 25 Feb 2019 13:02:06 +0000 (14:02 +0100)
grub_efi_get_ram_base() looks for the lowest available RAM address by
traversing the memory map, comparing lowest address found so far.
Due to a brain glitch, that "so far" was initialized to GRUB_UINT_MAX -
completely preventing boot on systems without RAM below 4GB.

Change the initial value to GRUB_EFI_MAX_USABLE_ADDRESS, as originally
intended.

Reported-by: Steve McIntyre <93sam@debian.org>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Steve McIntyre <93sam@debian.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/efi/mm.c

index a29af9fa507a765cf247d7e32dc382e36053a7b3..b02fab1b102e09cdccf2630e43501efe9e17cfa2 100644 (file)
@@ -653,7 +653,7 @@ grub_efi_get_ram_base(grub_addr_t *base_addr)
   if (ret < 1)
     return GRUB_ERR_BUG;
 
-  for (desc = memory_map, *base_addr = GRUB_UINT_MAX;
+  for (desc = memory_map, *base_addr = GRUB_EFI_MAX_USABLE_ADDRESS;
        (grub_addr_t) desc < ((grub_addr_t) memory_map + memory_map_size);
        desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
     if (desc->attribute & GRUB_EFI_MEMORY_WB)