linux-stable/arch/powerpc/kexec
Laurent Dufour 340a4a9f87 powerpc: Take in account addition CPU node when building kexec FDT
On a system with a large number of CPUs, the creation of the FDT for a
kexec kernel may fail because the allocated FDT is not large enough.

When this happens, such a message is displayed on the console:

  Unable to add ibm,processor-vadd-size property: FDT_ERR_NOSPACE

The property's name may change depending when the buffer overwrite is
detected.

Obviously the created FDT is missing information, and it is expected
that system dump or kexec kernel failed to run properly.

When the FDT is allocated, the size of the FDT the kernel received at
boot time is used and an extra size can be applied. Currently, only
memory added after boot time is taken in account, not the CPU nodes.

The extra size should take in account these additional CPU nodes and
compute the required extra space. To achieve that, the size of a CPU
node, including its subnode is computed once and multiplied by the
number of additional CPU nodes.

The assumption is that the size of the CPU node is _same_ for all the
node, the only variable part should be the name "PowerPC,POWERxx@##"
where "##" may vary a little.

Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
[mpe: Don't shadow function name w/variable, minor coding style changes]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221110180619.15796-3-ldufour@linux.ibm.com
2022-12-07 20:19:04 +11:00
..
core.c powerpc/64/kdump: Limit kdump base to 512MB 2022-09-28 19:22:09 +10:00
core_32.c powerpc: Remove CONFIG_FSL_BOOKE 2022-09-26 22:47:37 +10:00
core_64.c powerpc: Remove CONFIG_PPC_BOOK3E 2022-09-26 23:00:13 +10:00
crash.c powerpc/crash: save cpu register data in crash_smp_send_stop() 2022-07-28 16:22:13 +10:00
elf_64.c powerpc: If kexec_build_elf_info() fails return immediately from elf64_load() 2021-04-26 16:28:26 -05:00
file_load.c powerpc: Delete unused function delete_fdt_mem_rsv() 2021-03-08 12:06:30 -07:00
file_load_64.c powerpc: Take in account addition CPU node when building kexec FDT 2022-12-07 20:19:04 +11:00
Makefile powerpc/kasan: Disable address sanitization in kexec paths 2022-05-22 15:58:29 +10:00
ranges.c powerpc/64s: Move hash MMU support code under CONFIG_PPC_64S_HASH_MMU 2021-12-09 22:41:13 +11:00
relocate_32.S powerpc: Remove CONFIG_FSL_BOOKE 2022-09-26 22:47:37 +10:00