arm64: kdump: provide /proc/vmcore file
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Mon, 3 Apr 2017 02:24:38 +0000 (11:24 +0900)
committerAKASHI Takahiro <takahiro.akashi@linaro.org>
Mon, 19 Jun 2017 06:09:06 +0000 (15:09 +0900)
commit59e464c3ceacde316ecdb2bfd9a4d312f9f4a024
tree832e2860003ce8440734b7c2a68f10084d995f10
parent8c6faddfc7b65836d2105a1a0ed01dc5af3d3604
arm64: kdump: provide /proc/vmcore file

Arch-specific functions are added to allow for implementing a crash dump
file interface, /proc/vmcore, which can be viewed as a ELF file.

A user space tool, like kexec-tools, is responsible for allocating
a separate region for the core's ELF header within crash kdump kernel
memory and filling it in when executing kexec_load().

Then, its location will be advertised to crash dump kernel via a new
device-tree property, "linux,elfcorehdr", and crash dump kernel preserves
the region for later use with reserve_elfcorehdr() at boot time.

On crash dump kernel, /proc/vmcore will access the primary kernel's memory
with copy_oldmem_page(), which feeds the data page-by-page by ioremap'ing
it since it does not reside in linear mapping on crash dump kernel.

Meanwhile, elfcorehdr_read() is simple as the region is always mapped.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: James Morse <james.morse@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Conflicts:
arch/arm64/kernel/Makefile
due to missing commit 214fad550772 ("arm64: relocation testing module")
arch/arm64/Kconfig
arch/arm64/kernel/Makefile
arch/arm64/kernel/crash_dump.c [new file with mode: 0644]
arch/arm64/mm/init.c