|
When CPUs or memory are hot-plugged on a running system, the crash
dump's elfcorehdr -- which describes the available CPUs and memory to
the capture kernel -- must be kept in sync, otherwise a crash after a
hotplug event would produce a vmcore that does not reflect the current
system topology.
Enable crash hotplug for RISC-V by selecting
ARCH_SUPPORTS_CRASH_HOTPLUG and providing the three architecture hooks
invoked through the override macros in <asm/kexec.h>:
arch_crash_hotplug_support() reports whether an image supports the
mechanism; arch_crash_get_elfcorehdr_size() sizes the segment for
NR_CPUS and, with memory hotplug, CRASH_MAX_MEMORY_RANGES;
arch_crash_handle_hotplug_event() rebuilds the elfcorehdr through the
crash_prepare_headers() helper and writes it over the old segment.
The elfcorehdr is copied with memcpy_flushcache(), matching the x86
implementation; on RISC-V this currently expands to a plain memcpy()
and will benefit automatically once the architecture provides a
flushcache backend. The implementation otherwise follows the x86 crash
hotplug model.
Signed-off-by: Rui Qi <qirui.001@bytedance.com>
Tested-by: Rui Qi <qirui.001@bytedance.com>
Link: https://patch.msgid.link/20260910032619.2477279-1-qirui.001@bytedance.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
|