Re: [PATCH v6 12/14] crash: Normalize the kexec_load elfcorehdr at load time

From: sashiko-bot

Date: Mon Sep 21 2026 - 05:27:14 EST


> For kexec_load() the kernel does not build the elfcorehdr, so it is only
> rewritten by the first crash hotplug event. CPU hotplug events do not
> change the elfcorehdr, but they may run without device_hotplug_lock
> (e.g. CPU offlining during suspend), so they cannot perform that rewrite
> without racing with memory hotplug.
>
> Normalize the elfcorehdr once when the crash image is installed via
> crash_hotplug_prepare_elfcorehdr(), while device_hotplug_lock can still
> be taken safely, and let the hotplug paths skip CPU events entirely.
> Architectures that do not need the rewrite (e.g. powerpc) treat
> KEXEC_CRASH_HP_NONE as a no-op.
>
> The x86 crash hotplug handler now skips CPU hotplug events
> unconditionally, so nothing reads image->elfcorehdr_updated anymore.
> Drop the field and the code that maintains it.
> [ ... ]
> Cc: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>
> Cc: Pratyush Yadav <pratyush@xxxxxxxxxx>
> Cc: Dave Young <ruirui.yang@xxxxxxxxx>
> Cc: Sourabh Jain <sourabhjain@xxxxxxxxxxxxx>
> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>

Sashiko has reviewed this patch and found no issues. It looks great!

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921090450.807575-1-ruanjinjie@xxxxxxxxxx?part=12