Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc/fadump: fix additional param memory reservation for HASH MMU

Commit 683eab94da75bc ("powerpc/fadump: setup additional parameters for
dump capture kernel") introduced the additional parameter feature in
fadump for HASH MMU with the understanding that GRUB does not use the
memory area between 640MB and 768MB for its operation.

However, the third patch in this series ("powerpc: increase MIN RMA
size for CAS negotiation") changes the MIN RMA size to 768MB, allowing
GRUB to use memory up to 768MB. This makes the fadump reservation for
the additional parameter feature for HASH MMU unreliable.

To address this, adjust the memory range for the additional parameter in
fadump for HASH MMU. This will ensure that GRUB does not overwrite the
memory reserved for fadump's additional parameter in HASH MMU.

The new policy for the memory range for the additional parameter in HASH
MMU is that the first memory block must be larger than the MIN_RMA size,
as the bootloader can use memory up to the MIN_RMA size. The range
should be between MIN_RMA and the RMA size (ppc64_rma_size), and it must
not overlap with the fadump reserved area.

Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Reviewed-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250123114254.200527-3-sourabhjain@linux.ibm.com

authored by

Sourabh Jain and committed by
Madhavan Srinivasan
b7bb4606 0bdd7ff5

+11 -10
+11 -10
arch/powerpc/kernel/fadump.c
··· 33 33 #include <asm/fadump-internal.h> 34 34 #include <asm/setup.h> 35 35 #include <asm/interrupt.h> 36 + #include <asm/prom.h> 36 37 37 38 /* 38 39 * The CPU who acquired the lock to trigger the fadump crash should ··· 1765 1764 range_end = memblock_end_of_DRAM(); 1766 1765 } else { 1767 1766 /* 1768 - * Passing additional parameters is supported for hash MMU only 1769 - * if the first memory block size is 768MB or higher. 1767 + * Memory range for passing additional parameters for HASH MMU 1768 + * must meet the following conditions: 1769 + * 1. The first memory block size must be higher than the 1770 + * minimum RMA (MIN_RMA) size. Bootloader can use memory 1771 + * upto RMA size. So it should be avoided. 1772 + * 2. The range should be between MIN_RMA and RMA size (ppc64_rma_size) 1773 + * 3. It must not overlap with the fadump reserved area. 1770 1774 */ 1771 - if (ppc64_rma_size < 0x30000000) 1775 + if (ppc64_rma_size < MIN_RMA*1024*1024) 1772 1776 return; 1773 1777 1774 - /* 1775 - * 640 MB to 768 MB is not used by PFW/bootloader. So, try reserving 1776 - * memory for passing additional parameters in this range to avoid 1777 - * being stomped on by PFW/bootloader. 1778 - */ 1779 - range_start = 0x2A000000; 1780 - range_end = range_start + 0x4000000; 1778 + range_start = MIN_RMA * 1024 * 1024; 1779 + range_end = min(ppc64_rma_size, fw_dump.boot_mem_top); 1781 1780 } 1782 1781 1783 1782 fw_dump.param_area = memblock_phys_alloc_range(COMMAND_LINE_SIZE,