powerpc/fadump: add support to preserve crash data on FADUMP disabled kernel
authorHari Bathini <hbathini@linux.ibm.com>
Wed, 11 Sep 2019 14:56:03 +0000 (20:26 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 13 Sep 2019 14:04:45 +0000 (00:04 +1000)
commitbec53196adf4791d466adf0e339b61186c7b5283
treed21c6ffd50038faa23011ca14fddeecaabdb6fbc
parentb2a815a554a34f0e6fab4526ae762d5528783600
powerpc/fadump: add support to preserve crash data on FADUMP disabled kernel

Add a new kernel config option, CONFIG_PRESERVE_FA_DUMP that ensures
that crash data, from previously crash'ed kernel, is preserved. This
helps in cases where FADump is not enabled but the subsequent memory
preserving kernel boot is likely to process this crash data. One
typical usecase for this config option is petitboot kernel.

As OPAL allows registering address with it in the first kernel and
retrieving it after MPIPL, use it to store the top of boot memory.
A kernel that intends to preserve crash data retrieves it and avoids
using memory beyond this address.

Move arch_reserved_kernel_pages() function as it is needed for both
FA_DUMP and PRESERVE_FA_DUMP configurations.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/156821375751.5656.11459483669542541602.stgit@hbathini.in.ibm.com
arch/powerpc/Kconfig
arch/powerpc/include/asm/fadump-internal.h
arch/powerpc/include/asm/fadump.h
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/fadump.c
arch/powerpc/kernel/prom.c
arch/powerpc/platforms/powernv/Makefile
arch/powerpc/platforms/powernv/opal-fadump.c