Skip to content

Commit fc546fa

Browse files
sourabhjainsmpe
authored andcommitted
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: 2377c92 ("powerpc/kexec_file: fix FDT size estimation for kdump kernel") Signed-off-by: Sourabh Jain <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 111bcb3 commit fc546fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kexec/file_load_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image)
990990
* number of usable memory entries and use for FDT size estimation.
991991
*/
992992
if (drmem_lmb_size()) {
993-
usm_entries = ((memblock_end_of_DRAM() / drmem_lmb_size()) +
993+
usm_entries = ((memory_hotplug_max() / drmem_lmb_size()) +
994994
(2 * (resource_size(&crashk_res) / drmem_lmb_size())));
995995
extra_size = (unsigned int)(usm_entries * sizeof(u64));
996996
} else {

0 commit comments

Comments
 (0)