[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] arm64/efi: fix grub_efi_get_ram_base()

From: Leif Lindholm
Subject: [PATCH] arm64/efi: fix grub_efi_get_ram_base()
Date: Thu, 21 Feb 2019 10:15:08 +0000

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

Reported-by: Steve McIntyre <address@hidden>
Signed-off-by: Leif Lindholm <address@hidden>
 grub-core/kern/efi/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index 42ad7c570..cfe9764b7 100644
--- a/grub-core/kern/efi/mm.c
+++ b/grub-core/kern/efi/mm.c
@@ -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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]