RISC-V: Add crash kernel support
authorNick Kossifidis <mick@ics.forth.gr>
Mon, 19 Apr 2021 00:55:39 +0000 (03:55 +0300)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Mon, 26 Apr 2021 15:25:24 +0000 (08:25 -0700)
commit5640975003d0234da08559677e22ec25b9cb3267
treea6707467c591146b277e5d846ef5d8fbe9d01bea
parente53d28180d4d0fd12b6d2bde49cb87aa775b6ba8
RISC-V: Add crash kernel support

This patch allows Linux to act as a crash kernel for use with
kdump. Userspace will let the crash kernel know about the
memory region it can use through linux,usable-memory property
on the /memory node (overriding its reg property), and about the
memory region where the elf core header of the previous kernel
is saved, through a reserved-memory node with a compatible string
of "linux,elfcorehdr". This approach is the least invasive and
re-uses functionality already present.

I tested this on riscv64 qemu and it works as expected, you
may test it by retrieving the dmesg of the previous kernel
through /proc/vmcore, using the vmcore-dmesg utility from
kexec-tools.

Signed-off-by: Nick Kossifidis <mick@ics.forth.gr>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/Kconfig
arch/riscv/kernel/Makefile
arch/riscv/kernel/crash_dump.c [new file with mode: 0644]
arch/riscv/kernel/setup.c
arch/riscv/mm/init.c