File kdump-calibrate-do-not-add-KDUMP_PHYS_LOAD-to-RAM.patch of Package kdump.21349

From: Petr Tesarik <ptesarik@suse.com>
Date: Tue, 20 Feb 2018 20:44:40 +0100
Subject: calibrate: Do not add KDUMP_PHYS_LOAD to required RAM
Upstream: merged
Git-commit: b70cbda10aa73f72f2324b8f9bf58918b59c9a86

The memory between 0 and KDUMP_PHYS_LOAD is not really allocated to
the panic kernel. It is added to the requirement merely to calculate
the memmap size for pages in this range.

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
---
 kdumptool/calibrate.cc |    4 ++++
 1 file changed, 4 insertions(+)

--- a/kdumptool/calibrate.cc
+++ b/kdumptool/calibrate.cc
@@ -968,6 +968,10 @@ void Calibrate::execute()
 	required = prev + align_memmap(maxpfn) * SIZE_STRUCT_PAGE;
         Debug::debug()->dbg("Maximum memmap size: %lu KiB", required - prev);
 
+        // Memory between 0 and KDUMP_PHYS_LOAD is not really allocated,
+        // so subtract it again after memmap has been sized.
+	required -= KDUMP_PHYS_LOAD;
+
 	// Make sure there is enough space at boot
 	Debug::debug()->dbg("Total run-time size: %lu KiB", required);
 	if (required < bootsize)
openSUSE Build Service is sponsored by