Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Sourabh Jain and committed by
Michael Ellerman
fc546faa 111bcb37

+1 -1
+1 -1
arch/powerpc/kexec/file_load_64.c
··· 990 990 * number of usable memory entries and use for FDT size estimation. 991 991 */ 992 992 if (drmem_lmb_size()) { 993 - usm_entries = ((memblock_end_of_DRAM() / drmem_lmb_size()) + 993 + usm_entries = ((memory_hotplug_max() / drmem_lmb_size()) + 994 994 (2 * (resource_size(&crashk_res) / drmem_lmb_size()))); 995 995 extra_size = (unsigned int)(usm_entries * sizeof(u64)); 996 996 } else {