linux/arch/powerpc/kexec
Sourabh Jain b7b634be76 powerpc/crash: adjust the elfcorehdr size
[ Upstream commit 04e707cb77 ]

With crash hotplug support enabled, additional memory is allocated to
the elfcorehdr kexec segment to accommodate resources added during
memory hotplug events. However, the kdump FDT is not updated with the
same size, which can result in elfcorehdr corruption in the kdump
kernel.

Update elf_headers_sz (the kimage member representing the size of the
elfcorehdr kexec segment) to reflect the total memory allocated for the
elfcorehdr segment instead of the elfcorehdr buffer size at the time of
kdump load. This allows of_kexec_alloc_and_setup_fdt() to reserve the
full elfcorehdr memory in the kdump FDT and prevents elfcorehdr
corruption.

Fixes: 849599b702 ("powerpc/crash: add crash memory hotplug support")
Reviewed-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260227171801.2238847-1-sourabhjain@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-03-19 16:08:11 +01:00
..
core.c powerpc/kexec/core: use big-endian types for crash variables 2026-03-19 16:08:11 +01:00
core_32.c kexec: Consolidate machine_kexec_mask_interrupts() implementation 2024-12-11 20:32:34 +01:00
core_64.c powerpc/kexec: Enable SMT before waking offline CPUs 2026-01-02 12:57:25 +01:00
crash.c powerpc/crash: Fix non-smp kexec preparation 2025-04-29 11:40:46 +05:30
elf_64.c powerpc/kexec_file: fix extra size calculation for kexec FDT 2024-06-17 22:48:45 +10: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/crash: adjust the elfcorehdr size 2026-03-19 16:08:11 +01:00
Makefile powerpc/kexec: move *_memory_ranges functions to ranges.c 2024-04-23 14:59:01 +10:00
ranges.c powerpc/kdump: Fix size calculation for hot-removed memory ranges 2025-12-18 14:02:55 +01:00
relocate_32.S powerpc/kexec: fix physical address calculation in clear_utlb_entry() 2025-03-10 10:10:55 +05:30
vmcore_info.c arch, crash: move arch_crash_save_vmcoreinfo() out to file vmcore_info.c 2024-02-23 17:48:25 -08:00