Commit 1bcca862 authored by Youling Tang's avatar Youling Tang Committed by Huacai Chen
Browse files

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: default avatarYouling Tang <tangyouling@kylinos.cn>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent fc9c112f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment