arm64: kernel: arch_crash_save_vmcoreinfo() should depend on CONFIG_CRASH_CORE
authorJames Morse <james.morse@arm.com>
Mon, 10 Sep 2018 14:20:54 +0000 (15:20 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 11 Sep 2018 10:08:49 +0000 (11:08 +0100)
commit84c57dbd3c480fb2730c393a2cef994ddb4f42cc
tree2cb96441500feb8c3740cb7f754d66a03929d826
parent13aceef06adfaf93d52e01e28a8bc8a0ad471d83
arm64: kernel: arch_crash_save_vmcoreinfo() should depend on CONFIG_CRASH_CORE

Since commit 23c85094fe18 ("proc/kcore: add vmcoreinfo note to /proc/kcore")
the kernel has exported the vmcoreinfo PT_NOTE on /proc/kcore as well
as /proc/vmcore.

arm64 only exposes it's additional arch information via
arch_crash_save_vmcoreinfo() if built with CONFIG_KEXEC, as kdump was
previously the only user of vmcoreinfo.

Move this weak function to a separate file that is built at the same
time as its caller in kernel/crash_core.c. This ensures values like
'kimage_voffset' are always present in the vmcoreinfo PT_NOTE.

CC: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Bhupesh Sharma <bhsharma@redhat.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/Makefile
arch/arm64/kernel/crash_core.c [new file with mode: 0644]
arch/arm64/kernel/machine_kexec.c