summaryrefslogtreecommitdiff
path: root/kexec/arch/arm/crashdump-arm.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2021-10-05 14:40:32 +0200
committerSimon Horman <horms@verge.net.au>2021-10-20 12:02:20 +0200
commit5f8d632657d71d086bd55deaeea99f13bfbdf8d8 (patch)
tree008154c428fc1ac17d8547db77ef5d3b92955e03 /kexec/arch/arm/crashdump-arm.c
parentbb1c95cb460501c8a11a73b9a729984b6dcecf72 (diff)
arm: kdump: Add DT properties to crash dump kernel's DTB
Pass the following properties to the crash dump kernel, to provide a modern DT interface between kexec and the crash dump kernel: - linux,elfcorehdr: ELF core header segment, similar to the "elfcorehdr=" kernel parameter. - linux,usable-memory-range: Usable memory reserved for the crash dump kernel. This makes the memory reservation explicit, so Linux no longer needs to mask the program counter, and rely on the "mem=" kernel parameter to obtain the start and size of usable memory. For backwards compatibility, the "elfcorehdr=" and "mem=" kernel parameters are still appended to the kernel command line. Loosely based on the ARM64 version by Akashi Takahiro. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/arm/crashdump-arm.c')
-rw-r--r--kexec/arch/arm/crashdump-arm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
index daa4788..1ec1826 100644
--- a/kexec/arch/arm/crashdump-arm.c
+++ b/kexec/arch/arm/crashdump-arm.c
@@ -54,7 +54,7 @@ struct memory_ranges usablemem_rgns = {
};
/* The boot-time physical memory range reserved for crashkernel region */
-static struct memory_range crash_kernel_mem;
+struct memory_range crash_kernel_mem;
/* reserved regions */
#define CRASH_MAX_RESERVED_RANGES 2
@@ -64,6 +64,8 @@ static struct memory_ranges crash_reserved_rgns = {
.ranges = crash_reserved_ranges,
};
+struct memory_range elfcorehdr_mem;
+
static struct crash_elf_info elf_info = {
.class = ELFCLASS32,
.data = ELFDATANATIVE,
@@ -307,7 +309,11 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
crash_kernel_mem.start,
crash_kernel_mem.end, -1, 0);
- dbgprintf("elfcorehdr: %#lx\n", elfcorehdr);
+ elfcorehdr_mem.start = elfcorehdr;
+ elfcorehdr_mem.end = elfcorehdr + bufsz - 1;
+
+ dbgprintf("elfcorehdr 0x%llx-0x%llx\n", elfcorehdr_mem.start,
+ elfcorehdr_mem.end);
cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
/*