xref: /linux/Documentation/arch/arm64/kdump.rst (revision 34dc1baba215b826e454b8d19e4f24adbeb7d00d)
1=======================================
2crashkernel memory reservation on arm64
3=======================================
4
5Author: Baoquan He <bhe@redhat.com>
6
7Kdump mechanism is used to capture a corrupted kernel vmcore so that
8it can be subsequently analyzed. In order to do this, a preliminarily
9reserved memory is needed to pre-load the kdump kernel and boot such
10kernel if corruption happens.
11
12That reserved memory for kdump is adapted to be able to minimally
13accommodate the kdump kernel and the user space programs needed for the
14vmcore collection.
15
16Kernel parameter
17================
18
19Through the kernel parameters below, memory can be reserved accordingly
20during the early stage of the first kernel booting so that a continuous
21large chunk of memomy can be found. The low memory reservation needs to
22be considered if the crashkernel is reserved from the high memory area.
23
24- crashkernel=size@offset
25- crashkernel=size
26- crashkernel=size,high crashkernel=size,low
27
28Low memory and high memory
29==========================
30
31For kdump reservations, low memory is the memory area under a specific
32limit, usually decided by the accessible address bits of the DMA-capable
33devices needed by the kdump kernel to run. Those devices not related to
34vmcore dumping can be ignored. On arm64, the low memory upper bound is
35not fixed: it is 1G on the RPi4 platform but 4G on most other systems.
36On special kernels built with CONFIG_ZONE_(DMA|DMA32) disabled, the
37whole system RAM is low memory. Outside of the low memory described
38above, the rest of system RAM is considered high memory.
39
40Implementation
41==============
42
431) crashkernel=size@offset
44--------------------------
45
46The crashkernel memory must be reserved at the user-specified region or
47fail if already occupied.
48
49
502) crashkernel=size
51-------------------
52
53The crashkernel memory region will be reserved in any available position
54according to the search order:
55
56Firstly, the kernel searches the low memory area for an available region
57with the specified size.
58
59If searching for low memory fails, the kernel falls back to searching
60the high memory area for an available region of the specified size. If
61the reservation in high memory succeeds, a default size reservation in
62the low memory will be done. Currently the default size is 128M,
63sufficient for the low memory needs of the kdump kernel.
64
65Note: crashkernel=size is the recommended option for crashkernel kernel
66reservations. The user would not need to know the system memory layout
67for a specific platform.
68
693) crashkernel=size,high crashkernel=size,low
70---------------------------------------------
71
72crashkernel=size,(high|low) are an important supplement to
73crashkernel=size. They allows the user to specify how much memory needs
74to be allocated from the high memory and low memory respectively. On
75many systems the low memory is precious and crashkernel reservations
76from this area should be kept to a minimum.
77
78To reserve memory for crashkernel=size,high, searching is first
79attempted from the high memory region. If the reservation succeeds, the
80low memory reservation will be done subsequently.
81
82If reservation from the high memory failed, the kernel falls back to
83searching the low memory with the specified size in crashkernel=,high.
84If it succeeds, no further reservation for low memory is needed.
85
86Notes:
87
88- If crashkernel=,low is not specified, the default low memory
89  reservation will be done automatically.
90
91- if crashkernel=0,low is specified, it means that the low memory
92  reservation is omitted intentionally.
93