@@ -43,6 +43,12 @@
#define MIN_BOOT_MEM (((RMA_END < (0x1UL << 28)) ? (0x1UL << 28) : RMA_END) \
+ (0x1UL << 26))
+/*
+ * Maximum memory needed for fadump to boot up successfully. Use this as
+ * an upper limit for fadump so we don't endup reserving excess memory.
+ */
+#define MAX_BOOT_MEM (0x1UL << 32)
+
#define memblock_num_regions(memblock_type) (memblock.memblock_type.cnt)
#ifndef ELF_CORE_EFLAGS
@@ -225,6 +225,10 @@ static inline unsigned long fadump_calculate_reserve_size(void)
/* round it down in multiples of 256 */
size = size & ~0x0FFFFFFFUL;
+ /* Set an upper limit on the memory to be reserved */
+ if (size > MAX_BOOT_MEM)
+ size = MAX_BOOT_MEM;
+
/* Truncate to memory_limit. We don't want to over reserve the memory.*/
if (memory_limit && size > memory_limit)
size = memory_limit;
When boot memory size for fadump is not specified, memory is reserved for fadump based on system RAM size. As the system RAM size increases, the memory reserved for fadump increases as well. This patch sets an upper limit on the memory reserved for fadump, to avoid reserving excess memory. Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com> --- arch/powerpc/include/asm/fadump.h | 6 ++++++ arch/powerpc/kernel/fadump.c | 4 ++++ 2 files changed, 10 insertions(+)