crash: split vmcoreinfo exporting code out from crash_core.c
authorBaoquan He <bhe@redhat.com>
Wed, 24 Jan 2024 05:12:42 +0000 (13:12 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 24 Feb 2024 01:48:22 +0000 (17:48 -0800)
commit443cbaf9e2fdbef7d7cae457434a6cb8a679441b
treeb8e215ce96c62496ef0035e5c63f00e34b428f8d
parent85fcde402db191b5f222ebfecda653777d7d084e
crash: split vmcoreinfo exporting code out from crash_core.c

Now move the relevant codes into separate files:
kernel/crash_reserve.c, include/linux/crash_reserve.h.

And add config item CRASH_RESERVE to control its enabling.

And also update the old ifdeffery of CONFIG_CRASH_CORE, including of
<linux/crash_core.h> and config item dependency on CRASH_CORE
accordingly.

And also do renaming as follows:
 - arch/xxx/kernel/{crash_core.c => vmcore_info.c}
because they are only related to vmcoreinfo exporting on x86, arm64,
riscv.

And also Remove config item CRASH_CORE, and rely on CONFIG_KEXEC_CORE to
decide if build in crash_core.c.

[yang.lee@linux.alibaba.com: remove duplicated include in vmcore_info.c]
Link: https://lkml.kernel.org/r/20240126005744.16561-1-yang.lee@linux.alibaba.com
Link: https://lkml.kernel.org/r/20240124051254.67105-3-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Acked-by: Hari Bathini <hbathini@linux.ibm.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Pingfan Liu <piliu@redhat.com>
Cc: Klara Modin <klarasmodin@gmail.com>
Cc: Michael Kelley <mhklinux@outlook.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
24 files changed:
arch/arm64/kernel/Makefile
arch/arm64/kernel/vmcore_info.c [moved from arch/arm64/kernel/crash_core.c with 97% similarity]
arch/powerpc/Kconfig
arch/powerpc/kernel/setup-common.c
arch/powerpc/platforms/powernv/opal-core.c
arch/riscv/kernel/Makefile
arch/riscv/kernel/vmcore_info.c [moved from arch/riscv/kernel/crash_core.c with 96% similarity]
arch/x86/kernel/Makefile
arch/x86/kernel/vmcore_info_32.c [moved from arch/x86/kernel/crash_core_32.c with 90% similarity]
arch/x86/kernel/vmcore_info_64.c [moved from arch/x86/kernel/crash_core_64.c with 94% similarity]
drivers/firmware/qemu_fw_cfg.c
fs/proc/Kconfig
fs/proc/kcore.c
include/linux/buildid.h
include/linux/crash_core.h
include/linux/kexec.h
include/linux/vmcore_info.h [new file with mode: 0644]
kernel/Kconfig.kexec
kernel/Makefile
kernel/crash_core.c
kernel/ksysfs.c
kernel/printk/printk.c
kernel/vmcore_info.c [new file with mode: 0644]
lib/buildid.c