diff options
author | Hari Bathini <hbathini@linux.ibm.com> | 2020-07-29 14:42:58 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-07-29 16:47:54 +0300 |
commit | 1a1cf93c200581c72a3cd521e1e0a1a3b5d0077d (patch) | |
tree | cb3c966e21b0bd1d04a7d33fa2199d5d1109a2ae /arch/powerpc/kexec/elf_64.c | |
parent | 7c64e21a1c5a5bcd651d895b8faa68e9cdcc433d (diff) | |
download | linux-1a1cf93c200581c72a3cd521e1e0a1a3b5d0077d.tar.xz |
powerpc/kexec_file: Setup backup region for kdump kernel
Though kdump kernel boots from loaded address, the first 64KB of it is
copied down to real 0. So, setup a backup region and let purgatory
copy the first 64KB of crashed kernel into this backup region before
booting into kdump kernel. Update reserve map with backup region and
crashed kernel's memory to avoid kdump kernel from accidentially using
that memory.
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/159602294718.575379.16216507537038008623.stgit@hbathini
Diffstat (limited to 'arch/powerpc/kexec/elf_64.c')
-rw-r--r-- | arch/powerpc/kexec/elf_64.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/kexec/elf_64.c b/arch/powerpc/kexec/elf_64.c index 64c15a5a280b..76e2fc7e6dc3 100644 --- a/arch/powerpc/kexec/elf_64.c +++ b/arch/powerpc/kexec/elf_64.c @@ -68,6 +68,15 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, pr_debug("Loaded purgatory at 0x%lx\n", pbuf.mem); + /* Load additional segments needed for panic kernel */ + if (image->type == KEXEC_TYPE_CRASH) { + ret = load_crashdump_segments_ppc64(image, &kbuf); + if (ret) { + pr_err("Failed to load kdump kernel segments\n"); + goto out; + } + } + if (initrd != NULL) { kbuf.buffer = initrd; kbuf.bufsz = kbuf.memsz = initrd_len; |