powerpc/fadump: use static allocation for reserved memory ranges
commitd72eb20a639b6f6e2b1add0adb1e29a5b6f11dbf
authorHari Bathini <hbathini@linux.ibm.com>
Mon, 20 Apr 2020 08:56:09 +0000 (20 14:26 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:33:05 +0000 (22 09:33 +0200)
tree948c3dab34a250cbc46948d2b3a2e22e5ae64204
parente72001050c811d7f4a2ed51423c638c693d33bed
powerpc/fadump: use static allocation for reserved memory ranges

commit 02c04e374e176ae3a3f64a682f80702f8d2fb65d upstream.

At times, memory ranges have to be looked up during early boot, when
kernel couldn't be initialized for dynamic memory allocation. In fact,
reserved-ranges look up is needed during FADump memory reservation.
Without accounting for reserved-ranges in reserving memory for FADump,
MPIPL boot fails with memory corruption issues. So, extend memory
ranges handling to support static allocation and populate reserved
memory ranges during early boot.

Fixes: dda9dbfeeb7a ("powerpc/fadump: consider reserved ranges while releasing memory")
Cc: stable@vger.kernel.org
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/158737294432.26700.4830263187856221314.stgit@hbathini.in.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/fadump-internal.h
arch/powerpc/kernel/fadump.c