Skip to content

Commit ab892bb

Browse files
author
Mamatha Inamdar
committed
powerpc/fadump: fix additional param memory reservation for HASH MMU
JIRA: https://issues.redhat.com/browse/RHEL-74219 commit b7bb460 Author: Sourabh Jain <[email protected]> Date: Thu Jan 23 17:12:52 2025 +0530 powerpc/fadump: fix additional param memory reservation for HASH MMU Commit 683eab9 ("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 <[email protected]> Signed-off-by: Sourabh Jain <[email protected]> Reviewed-by: Hari Bathini <[email protected]> Signed-off-by: Madhavan Srinivasan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mamatha Inamdar <[email protected]>
1 parent 879868b commit ab892bb

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

arch/powerpc/kernel/fadump.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <asm/fadump-internal.h>
3434
#include <asm/setup.h>
3535
#include <asm/interrupt.h>
36+
#include <asm/prom.h>
3637

3738
/*
3839
* The CPU who acquired the lock to trigger the fadump crash should
@@ -1712,19 +1713,19 @@ void __init fadump_setup_param_area(void)
17121713
range_end = memblock_end_of_DRAM();
17131714
} else {
17141715
/*
1715-
* Passing additional parameters is supported for hash MMU only
1716-
* if the first memory block size is 768MB or higher.
1716+
* Memory range for passing additional parameters for HASH MMU
1717+
* must meet the following conditions:
1718+
* 1. The first memory block size must be higher than the
1719+
* minimum RMA (MIN_RMA) size. Bootloader can use memory
1720+
* upto RMA size. So it should be avoided.
1721+
* 2. The range should be between MIN_RMA and RMA size (ppc64_rma_size)
1722+
* 3. It must not overlap with the fadump reserved area.
17171723
*/
1718-
if (ppc64_rma_size < 0x30000000)
1724+
if (ppc64_rma_size < MIN_RMA*1024*1024)
17191725
return;
17201726

1721-
/*
1722-
* 640 MB to 768 MB is not used by PFW/bootloader. So, try reserving
1723-
* memory for passing additional parameters in this range to avoid
1724-
* being stomped on by PFW/bootloader.
1725-
*/
1726-
range_start = 0x2A000000;
1727-
range_end = range_start + 0x4000000;
1727+
range_start = MIN_RMA * 1024 * 1024;
1728+
range_end = min(ppc64_rma_size, fw_dump.boot_mem_top);
17281729
}
17291730

17301731
fw_dump.param_area = memblock_phys_alloc_range(COMMAND_LINE_SIZE,

0 commit comments

Comments
 (0)