Skip to content

Commit 97da2fb

Browse files
Automatic merge of 'next-test' into merge-test (2025-02-11 10:54)
2 parents 4430e6e + 61c403b commit 97da2fb

File tree

5 files changed

+38
-12
lines changed

5 files changed

+38
-12
lines changed

Documentation/ABI/testing/sysfs-kernel-fadump

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@ Date: May 2024
5555
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

+22
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

+2
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

+11-10
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
@@ -1764,19 +1765,19 @@ void __init fadump_setup_param_area(void)
17641765
range_end = memblock_end_of_DRAM();
17651766
} else {
17661767
/*
1767-
* Passing additional parameters is supported for hash MMU only
1768-
* if the first memory block size is 768MB or higher.
1768+
* Memory range for passing additional parameters for HASH MMU
1769+
* must meet the following conditions:
1770+
* 1. The first memory block size must be higher than the
1771+
* minimum RMA (MIN_RMA) size. Bootloader can use memory
1772+
* upto RMA size. So it should be avoided.
1773+
* 2. The range should be between MIN_RMA and RMA size (ppc64_rma_size)
1774+
* 3. It must not overlap with the fadump reserved area.
17691775
*/
1770-
if (ppc64_rma_size < 0x30000000)
1776+
if (ppc64_rma_size < MIN_RMA*1024*1024)
17711777
return;
17721778

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

17821783
fw_dump.param_area = memblock_phys_alloc_range(COMMAND_LINE_SIZE,

arch/powerpc/kernel/prom_init.c

+1-1
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)