]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
LoongArch: Add crash dump support for kexec_file
authorYouling Tang <tangyouling@kylinos.cn>
Thu, 2 Oct 2025 14:39:08 +0000 (22:39 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Thu, 2 Oct 2025 14:39:08 +0000 (22:39 +0800)
commit1bcca8620a915d2f98ad7641f82d799c17f04b93
tree838c807d61a054876091ca816783adcb7ee31edb
parentfc9c112f804abcd984a20a66a909332a147a23e8
LoongArch: Add crash dump support for kexec_file

Enabling crash dump (kdump) includes:
- Prepare contents of ELF header of a core dump file, /proc/vmcore,
  using crash_prepare_elf64_headers().
- Add "mem=size@start" parameter to the command line and pass it to the
  capture kernel.  Limit the runtime memory area of the captured kernel
  to avoid disrupting the production kernel's runtime state.
- Add "elfcorehdr=size@start" parameter to the cmdline.

The basic usage for kdump (add the cmdline parameter crashkernel=512M
to grub.cfg for production kernel):

1) Load capture kernel image (vmlinux.efi or vmlinux can both be used):
 # kexec -s -p vmlinuz.efi --initrd=initrd.img --reuse-cmdline

2) Do something to crash, like:
 # echo c > /proc/sysrq-trigger

Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kernel/machine_kexec_file.c