Skip to content

Commit 2145c2f

Browse files
author
CKI KWF Bot
committed
Merge: Updates for Grub RMA size
MR: https://gitlab.com/redhat/rhel/src/kernel/rhel-9/-/merge_requests/3394 Description: Updates for Grub RMA size JIRA: https://issues.redhat.com/browse/RHEL-74219 Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=66721237 Tested: This issue occurred due to lack of available memory in RMA region (Earlier size 512 MB, New size after the fix : 768 MB) for Grub2. The below observations and testings are done with just the kernel fixes (No Grub2 fixes are included). ________ Without the fix: The following errors are observed in Grub2 followed by kernel panic: ***** error: ../../grub-core/kern/mm.c:552:out of memory. . . [ 0.777633] List of all partitions: [ 0.777639] No filesystem could mount root, tried: [ 0.777649] Kernel panic - not syncing: VFS: Unable to mount root fs on "" or unknown-block(0,0) --And the memory looks like this below: memory layout at init: memory_limit : 0000000000000000 (16 MB aligned) alloc_bottom : 00000000108b0000 alloc_top : 0000000020000000 alloc_top_hi : 0000000020000000 rmo_top : 0000000020000000 <<<<< RMA ram_top : 0000000020000000 ***** _________ After the fix : None of the earlier errors were observed while booting. The RMA size has increased to 768 MB and the same can be seen while booting. ***** memory layout at init: memory_limit : 0000000000000000 (16 MB aligned) alloc_bottom : 0000000010e20000 alloc_top : 0000000030000000 alloc_top_hi : 0000000040000000 rmo_top : 0000000030000000 <<<<<RMA ram_top : 0000000040000000 ***** ________ FADump impact: This increase in RMA size to 768 MB has impacted the FADump. We have fixed this impact in FADump and the patch series has been tested with the following four scenarios, and both the production kernel and FADump kernel boot successfully: 1. Production Kernel: RADIX MMU FADump Kernel: RADIX MMU - MIN_RMA: 768 MB - RMA: 1 GB - a. crashkernel: 4 GB - b. crashkernel: 1 GB 2. Production Kernel: HASH MMU FADump Kernel: HASH MMU - MIN_RMA: 768 MB - RMA: 1 GB - a. crashkernel: 768 MB - b. crashkernel: 1 GB ________ Signed-off-by: Mamatha Inamdar <[email protected]> Approved-by: Steve Best <[email protected]> Approved-by: Tony Camuso <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: CKI KWF Bot <[email protected]>
2 parents aa2c6ba + 81d7dac commit 2145c2f

File tree

5 files changed

+38
-12
lines changed

5 files changed

+38
-12
lines changed

Documentation/ABI/testing/sysfs-kernel-fadump

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ Date: May 2024
4444
4545
Description: read/write
4646
This is a special sysfs file available to setup additional
47-
parameters to be passed to capture kernel.
47+
parameters to be passed to capture kernel. For HASH MMU it
48+
is exported only if RMA size higher than 768MB.

Documentation/powerpc/firmware-assisted-dump.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,28 @@ to ensure that crash data is preserved to process later.
120120
e.g.
121121
# echo 1 > /sys/firmware/opal/mpipl/release_core
122122

123+
-- Support for Additional Kernel Arguments in Fadump
124+
Fadump has a feature that allows passing additional kernel arguments
125+
to the fadump kernel. This feature was primarily designed to disable
126+
kernel functionalities that are not required for the fadump kernel
127+
and to reduce its memory footprint while collecting the dump.
128+
129+
Command to Add Additional Kernel Parameters to Fadump:
130+
e.g.
131+
# echo "nr_cpus=16" > /sys/kernel/fadump/bootargs_append
132+
133+
The above command is sufficient to add additional arguments to fadump.
134+
An explicit service restart is not required.
135+
136+
Command to Retrieve the Additional Fadump Arguments:
137+
e.g.
138+
# cat /sys/kernel/fadump/bootargs_append
139+
140+
Note: Additional kernel arguments for fadump with HASH MMU is only
141+
supported if the RMA size is greater than 768 MB. If the RMA
142+
size is less than 768 MB, the kernel does not export the
143+
/sys/kernel/fadump/bootargs_append sysfs node.
144+
123145
Implementation details:
124146
-----------------------
125147

arch/powerpc/include/asm/prom.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include <linux/of_irq.h>
2323
#include <linux/platform_device.h>
2424

25+
#define MIN_RMA 768 /* Minimum RMA (in MB) for CAS negotiation */
26+
2527
#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
2628
#define OF_DT_END_NODE 0x2 /* End node */
2729
#define OF_DT_PROP 0x3 /* Property: name off, size,

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,

arch/powerpc/kernel/prom_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ static const struct ibm_arch_vec ibm_architecture_vec_template __initconst = {
10671067
.virt_base = cpu_to_be32(0xffffffff),
10681068
.virt_size = cpu_to_be32(0xffffffff),
10691069
.load_base = cpu_to_be32(0xffffffff),
1070-
.min_rma = cpu_to_be32(512), /* 512MB min RMA */
1070+
.min_rma = cpu_to_be32(MIN_RMA),
10711071
.min_load = cpu_to_be32(0xffffffff), /* full client load */
10721072
.min_rma_percent = 0, /* min RMA percentage of total RAM */
10731073
.max_pft_size = 48, /* max log_2(hash table size) */

0 commit comments

Comments
 (0)