powerpc/kexec_file: Count hot-pluggable memory in FDT estimate
authorSourabh Jain <sourabhjain@linux.ibm.com>
Tue, 31 Jan 2023 03:06:15 +0000 (08:36 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 1 Feb 2023 02:04:40 +0000 (13:04 +1100)
commitfc546faa559538fb312c77e055243ece18ab3288
tree4663f011df7bf7183c15c48493b0b112fa4b5429
parent111bcb37385353f0510e5847d5abcd1c613dba23
powerpc/kexec_file: Count hot-pluggable memory in FDT estimate

On Systems where online memory is lesser compared to max memory, the
kexec_file_load system call may fail to load the kdump kernel with the
below errors:

    "Failed to update fdt with linux,drconf-usable-memory property"
    "Error setting up usable-memory property for kdump kernel"

This happens because the size estimation for usable memory properties
for the kdump kernel's FDT is based on the online memory whereas the
usable memory properties include max memory. In short, the hot-pluggable
memory is not accounted for while estimating the size of the usable
memory properties.

The issue is addressed by calculating usable memory property size using
max hotplug address instead of the last online memory address.

Fixes: 2377c92e37fe ("powerpc/kexec_file: fix FDT size estimation for kdump kernel")
Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230131030615.729894-1-sourabhjain@linux.ibm.com
arch/powerpc/kexec/file_load_64.c