Skip to content

Commit 965354a

Browse files
committed
Merge: Description: Updates for Grub RMA size
MR: https://gitlab.com/redhat/rhel/src/kernel/rhel-10/-/merge_requests/11 JIRA: https://issues.redhat.com/browse/RHEL-70827 Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=66721363 Tested: Verified Brew build test kernel RPMs 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 <minamdar@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: Eder Zulian <ezulian@redhat.com> Approved-by: Steve Best <sbest@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents 5b8f8cb + f61f187 commit 965354a

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
@@ -55,4 +55,5 @@ Date: May 2024
5555
Contact: linuxppc-dev@lists.ozlabs.org
5656
Description: read/write
5757
This is a special sysfs file available to setup additional
58-
parameters to be passed to capture kernel.
58+
parameters to be passed to capture kernel. For HASH MMU it
59+
is exported only if RMA size higher than 768MB.

Documentation/arch/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
@@ -17,6 +17,8 @@
1717
struct device_node;
1818
struct property;
1919

20+
#define MIN_RMA 768 /* Minimum RMA (in MB) for CAS negotiation */
21+
2022
#define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */
2123
#define OF_DT_END_NODE 0x2 /* End node */
2224
#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
@@ -1763,19 +1764,19 @@ void __init fadump_setup_param_area(void)
17631764
range_end = memblock_end_of_DRAM();
17641765
} else {
17651766
/*
1766-
* Passing additional parameters is supported for hash MMU only
1767-
* 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.
17681774
*/
1769-
if (ppc64_rma_size < 0x30000000)
1775+
if (ppc64_rma_size < MIN_RMA*1024*1024)
17701776
return;
17711777

1772-
/*
1773-
* 640 MB to 768 MB is not used by PFW/bootloader. So, try reserving
1774-
* memory for passing additional parameters in this range to avoid
1775-
* being stomped on by PFW/bootloader.
1776-
*/
1777-
range_start = 0x2A000000;
1778-
range_end = range_start + 0x4000000;
1778+
range_start = MIN_RMA * 1024 * 1024;
1779+
range_end = min(ppc64_rma_size, fw_dump.boot_mem_top);
17791780
}
17801781

17811782
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
@@ -1061,7 +1061,7 @@ static const struct ibm_arch_vec ibm_architecture_vec_template __initconst = {
10611061
.virt_base = cpu_to_be32(0xffffffff),
10621062
.virt_size = cpu_to_be32(0xffffffff),
10631063
.load_base = cpu_to_be32(0xffffffff),
1064-
.min_rma = cpu_to_be32(512), /* 512MB min RMA */
1064+
.min_rma = cpu_to_be32(MIN_RMA),
10651065
.min_load = cpu_to_be32(0xffffffff), /* full client load */
10661066
.min_rma_percent = 0, /* min RMA percentage of total RAM */
10671067
.max_pft_size = 48, /* max log_2(hash table size) */

0 commit comments

Comments
 (0)