powerpc/kexec_file: fix extra size calculation for kexec FDT
authorSourabh Jain <sourabhjain@linux.ibm.com>
Fri, 10 May 2024 10:22:34 +0000 (15:52 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 17 Jun 2024 12:48:45 +0000 (22:48 +1000)
commit0d3ff067331ef84e7e7f49537d768881042ed5ba
tree8a3b777f3dc0522b0451200cf2a3b46dd1b3011a
parent0300a92e96cb393a1891d3b4a0f00b28dde8643b
powerpc/kexec_file: fix extra size calculation for kexec FDT

While setting up the FDT for kexec, CPU nodes that are added after the
system boots and reserved memory ranges are incorporated into the
initial_boot_params (base FDT).

However, they are not taken into account when determining the additional
size needed for the kexec FDT. As a result, kexec fails to load,
generating the following error:

[1116.774451] Error updating memory reserve map: FDT_ERR_NOSPACE
kexec_file_load failed: No such process

Therefore, consider the extra size for CPU nodes added post-system boot
and reserved memory ranges while preparing the kexec FDT.

While adding a new parameter to the setup_new_fdt_ppc64 function, it was
noticed that there were a couple of unused parameters, so they were
removed.

Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240510102235.2269496-2-sourabhjain@linux.ibm.com
arch/powerpc/include/asm/kexec.h
arch/powerpc/kexec/elf_64.c
arch/powerpc/kexec/file_load_64.c