grub2/0282-ieee1275-claim-up-to-256MB-memory.patch
Javier Martinez Canillas b141171629
Appended signatures support, unify GRUB config location and some fixes
- Remove -fcf-protection compiler flag to allow i386 builds (law)
  Related: rhbz#1915452
- Unify GRUB configuration file location across all platforms
  Related: rhbz#1918817
- Add 'at_keyboard_fallback_set' var to force the set manually (rmetrich)
- Add appended signatures support for ppc64le LPAR Secure Boot (daxtens)

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2021-02-09 01:04:42 +01:00

53 lines
2.2 KiB
Diff

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