public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ppc64: Reserve FDT memory for full elfcorehdr memory size
@ 2026-02-10  5:05 Sourabh Jain
  2026-02-17 16:11 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Sourabh Jain @ 2026-02-10  5:05 UTC (permalink / raw)
  To: kexec; +Cc: Sourabh Jain, Shivang Upadhyay, Simon Horman

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

Fix this by updating the elfcorehdr size in the FDT memory
reservation entry to use its actual memsz instead of the current
buffer size.

Fixes: b8408c95e7c0 ("powerpc/kexec_load: add hotplug support")
Cc: Shivang Upadhyay <shivangu@linux.ibm.com>
Cc: Simon Horman <horms@kernel.org>
Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
---
 kexec/arch/ppc64/crashdump-ppc64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c
index 98d439a..2816a1b 100644
--- a/kexec/arch/ppc64/crashdump-ppc64.c
+++ b/kexec/arch/ppc64/crashdump-ppc64.c
@@ -543,7 +543,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
 	/* Record the location of the elfcorehdr for hotplug handling */
 	info->elfcorehdr = elfcorehdr = add_buffer(info, tmp, sz, memsz, align,
 						   min_base, max_addr, 1);
-	reserve(elfcorehdr, sz);
+	reserve(elfcorehdr, memsz);
 	/* modify and store the cmdline in a global array. This is later
 	 * read by flatten_device_tree and modified if required
 	 */
-- 
2.52.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-17 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10  5:05 [PATCH] ppc64: Reserve FDT memory for full elfcorehdr memory size Sourabh Jain
2026-02-17 16:11 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox