powerpc/kexec_file: Prepare elfcore header for crashing kernel
authorHari Bathini <hbathini@linux.ibm.com>
Wed, 29 Jul 2020 11:43:14 +0000 (17:13 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 29 Jul 2020 13:47:54 +0000 (23:47 +1000)
commitcb350c1f1f867db16725f1bb06be033ece19e998
tree8997d598bfb8be118dbb31ee156189afe8c55aa0
parent1a1cf93c200581c72a3cd521e1e0a1a3b5d0077d
powerpc/kexec_file: Prepare elfcore header for crashing kernel

Prepare elf headers for the crashing kernel's core file using
crash_prepare_elf64_headers() and pass on this info to kdump kernel by
updating its command line with elfcorehdr parameter. Also, add
elfcorehdr location to reserve map to avoid it from being stomped on
while booting.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Tested-by: Pingfan Liu <piliu@redhat.com>
Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
[mpe: Ensure cmdline is nul terminated]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/159602298855.575379.15819225623219909517.stgit@hbathini
arch/powerpc/include/asm/kexec.h
arch/powerpc/kexec/elf_64.c
arch/powerpc/kexec/file_load.c
arch/powerpc/kexec/file_load_64.c