dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0349-ieee1275-claim-up-to-256MB-memory.patch

5975ab
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
5975ab
From: Daniel Axtens <dja@axtens.net>
5975ab
Date: Wed, 28 Oct 2020 11:44:29 +1100
5975ab
Subject: [PATCH] ieee1275: claim up to 256MB memory
5975ab
5975ab
If we are verifying large kernels, we need more that 32MB. (Many distro
5975ab
kernels are quite large, and debug kernels can be even bigger!)
5975ab
5975ab
We originally went with 512MB: qemu pseries gives you all the memory a
5975ab
32-bit number can handle, so there was lots left over to place a linux image
5975ab
and initrd.
5975ab
5975ab
Here's what we said then:
5975ab
| This is possibly not the way we want to go with for upstream as it breaks
5975ab
| booting on systems with <= 512MB. We're working on a more upstream-friendly
5975ab
| solution and will post it shortly. However, for an end-user or packager with
5975ab
| a higher minimum memory requirement, this will work fine.
5975ab
5975ab
However, we've since discovered that (at least on one P8 test system), PFW
5975ab
doesn't expose all of the memory allocated to the LPAR: it looks like it just
5975ab
exposes 512MB - at least unless we mess with the CHRP note section.
5975ab
Therefore, if we try to claim 512MB in grub, things _do not_ work when we try
5975ab
to load linux. As a compromise, and again we'd like a better upstream solution,
5975ab
go for 256MB. This is at least enough to verify distro kernels.
5975ab
5975ab
Signed-off-by: Daniel Axtens <dja@axtens.net>
5975ab
---
5975ab
 grub-core/kern/ieee1275/init.c | 6 ++----
5975ab
 1 file changed, 2 insertions(+), 4 deletions(-)
5975ab
5975ab
diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
5975ab
index e731a57a47b..f8a4f8f4214 100644
5975ab
--- a/grub-core/kern/ieee1275/init.c
5975ab
+++ b/grub-core/kern/ieee1275/init.c
5975ab
@@ -49,15 +49,13 @@
5975ab
 #ifdef __i386__
5975ab
 #define HEAP_MAX_SIZE		(unsigned long) (64 * 1024 * 1024)
5975ab
 #else
5975ab
-#define HEAP_MAX_SIZE		(unsigned long) (32 * 1024 * 1024)
5975ab
+#define HEAP_MAX_SIZE		(unsigned long) (256 * 1024 * 1024)
5975ab
 #endif
5975ab
 
5975ab
-/* If possible, we will avoid claiming heap above this address, because it
5975ab
-   seems to cause relocation problems with OSes that link at 4 MiB */
5975ab
 #ifdef __i386__
5975ab
 #define HEAP_MAX_ADDR		(unsigned long) (64 * 1024 * 1024)
5975ab
 #else
5975ab
-#define HEAP_MAX_ADDR		(unsigned long) (32 * 1024 * 1024)
5975ab
+#define HEAP_MAX_ADDR		(unsigned long) (256 * 1024 * 1024)
5975ab
 #endif
5975ab
 
5975ab
 extern char _end[];