Skip to content

[PW_SID:1161737] [v2] riscv: crash: Add crash hotplug support - #2634

Open
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1161737
Open

[PW_SID:1161737] [v2] riscv: crash: Add crash hotplug support#2634
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1161737

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1161737 applied to workflow__riscv__fixes

Name: [v2] riscv: crash: Add crash hotplug support
URL: https://patchwork.kernel.org/series/1161737/
Version: 2

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>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants