851216d
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
851216d
From: Daniel Axtens <dja@axtens.net>
851216d
Date: Mon, 6 Feb 2023 10:03:21 -0500
851216d
Subject: [PATCH] ieee1275: drop len -= 1 quirk in heap_init
851216d
851216d
This was apparently 'required by some firmware': commit dc9468500919
851216d
("2007-02-12  Hollis Blanchard  <hollis@penguinppc.org>").
851216d
851216d
It's not clear what firmware that was, and what platform from 14 years ago
851216d
which exhibited the bug then is still both in use and buggy now.
851216d
851216d
It doesn't cause issues on qemu (mac99 or pseries) or under PFW for Power8.
851216d
851216d
I don't have access to old Mac hardware, but if anyone feels especially
851216d
strongly we can put it under some feature flag. I really want to disable
851216d
it under pseries because it will mess with region merging.
851216d
851216d
Signed-off-by: Daniel Axtens <dja@axtens.net>
851216d
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
851216d
(cherry picked from commit fc639d430297321ee4f77c5d2d698f698cec0dc7)
851216d
---
851216d
 grub-core/kern/ieee1275/init.c | 1 -
851216d
 1 file changed, 1 deletion(-)
851216d
851216d
diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
851216d
index 8ae405bc79..c8d551759d 100644
851216d
--- a/grub-core/kern/ieee1275/init.c
851216d
+++ b/grub-core/kern/ieee1275/init.c
851216d
@@ -168,7 +168,6 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type,
851216d
 	  addr = 0x180000;
851216d
 	}
851216d
     }
851216d
-  len -= 1; /* Required for some firmware.  */
851216d
 
851216d
   /* Never exceed HEAP_MAX_SIZE  */
851216d
   if (*total + len > HEAP_MAX_SIZE)