linux/arch/sh/kernel
Baoquan He 199da8714c arch, crash: move arch_crash_save_vmcoreinfo() out to file vmcore_info.c
Nathan reported below building error:

=====
$ curl -LSso .config https://git.alpinelinux.org/aports/plain/community/linux-edge/config-edge.armv7
$ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- olddefconfig all
..
arm-linux-gnueabi-ld: arch/arm/kernel/machine_kexec.o: in function `arch_crash_save_vmcoreinfo':
machine_kexec.c:(.text+0x488): undefined reference to `vmcoreinfo_append_str'
====

On architecutres, like arm, s390, ppc, sh, function
arch_crash_save_vmcoreinfo() is located in machine_kexec.c and it can
only be compiled in when CONFIG_KEXEC_CORE=y.

That's not right because arch_crash_save_vmcoreinfo() is used to export
arch specific vmcoreinfo. CONFIG_VMCORE_INFO is supposed to control its
compiling in. However, CONFIG_VMVCORE_INFO could be independent of
CONFIG_KEXEC_CORE, e.g CONFIG_PROC_KCORE=y will select CONFIG_VMVCORE_INFO.
Or CONFIG_KEXEC/CONFIG_KEXEC_FILE is set while CONFIG_CRASH_DUMP is
not set, it will report linking error.

So, on arm, s390, ppc and sh, move arch_crash_save_vmcoreinfo out to
a new file vmcore_info.c. Let CONFIG_VMCORE_INFO decide if compiling in
arch_crash_save_vmcoreinfo().

[akpm@linux-foundation.org: remove stray newlines at eof]
Link: https://lkml.kernel.org/r/20240129135033.157195-3-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/all/20240126045551.GA126645@dev-arch.thelio-3990X/T/#u
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Klara Modin <klarasmodin@gmail.com>
Cc: Michael Kelley <mhklinux@outlook.com>
Cc: Pingfan Liu <piliu@redhat.com>
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>
2024-02-23 17:48:25 -08:00
..
cpu sh: Remove unused SH4-202 support 2023-10-25 16:49:58 +02:00
syscalls lsm/stable-6.8 PR 20240105 2024-01-09 12:57:46 -08:00
vsyscall sh: vsyscall: Remove unnecessary $(foreach ...) 2024-01-19 11:57:12 +01:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
asm-offsets.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
crash_dump.c vmcore: convert copy_oldmem_page() to take an iov_iter 2022-04-29 14:37:59 -07:00
debugtraps.S sh: kernel: convert to SPDX identifiers 2018-12-28 12:11:45 -08:00
disassemble.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
dma-coherent.c dma-mapping: merge <linux/dma-noncoherent.h> into <linux/dma-map-ops.h> 2020-10-06 07:07:06 +02:00
dumpstack.c sh: stacktrace: Remove stacktrace_ops.stack() 2020-08-14 22:05:11 -04:00
dwarf.c It appears that the zero-day bot did find a bug in my sh build. 2019-01-05 14:08:00 -08:00
entry-common.S sh: fix syscall tracing 2020-09-13 21:22:55 -04:00
ftrace.c ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
head_32.S sh: init: use OF_EARLY_FLATTREE for early init 2023-03-23 10:00:03 +01:00
hw_breakpoint.c sh: kernel: hw_breakpoint: Fix missing break in switch statement 2019-08-11 16:15:16 -05:00
idle.c sh/cpu: Switch to arch_cpu_finalize_init() 2023-06-16 10:16:00 +02:00
io_trapped.c sh: remove CONFIG_SET_FS support 2022-02-25 09:36:06 +01:00
io.c sh: kernel: convert to SPDX identifiers 2018-12-28 12:11:45 -08:00
iomap.c iomap: constify ioreadX() iomem argument (as in generic implementation) 2020-08-14 19:56:57 -07:00
ioport.c sh: machvec: Remove custom ioport_{un,}map() 2023-10-25 16:50:30 +02:00
irq_32.c sh: kernel: convert to SPDX identifiers 2018-12-28 12:11:45 -08:00
irq.c asm-generic: Conditionally enable do_softirq_own_stack() via Kconfig. 2022-09-05 17:20:55 +02:00
kdebugfs.c sh: no need to check return value of debugfs_create functions 2019-06-03 15:39:40 +02:00
kgdb.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
kprobes.c kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
machine_kexec.c arch, crash: move arch_crash_save_vmcoreinfo() out to file vmcore_info.c 2024-02-23 17:48:25 -08:00
machvec.c sh: machvec: Use char[] for section boundaries 2022-09-13 10:33:17 -07:00
Makefile arch, crash: move arch_crash_save_vmcoreinfo() out to file vmcore_info.c 2024-02-23 17:48:25 -08:00
module.c sh: remove sh5 support 2020-06-01 14:48:52 -04:00
nmi_debug.c sh: nmi_debug: fix return value of __setup handler 2023-03-23 10:00:02 +01:00
perf_callchain.c sh: stacktrace: Remove stacktrace_ops.stack() 2020-08-14 22:05:11 -04:00
perf_event.c sh: Get rid of oprofile leftovers 2021-04-22 13:32:39 +01:00
process_32.c kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
process.c sh: remove sh5 support 2020-06-01 14:48:52 -04:00
ptrace_32.c sh: ptrace: user_regset_copyin_ignore() always returns 0 2022-11-15 14:30:41 -08:00
ptrace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
reboot.c sh, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC 2023-12-12 17:20:18 -08:00
relocate_kernel.S sh: kernel: convert to SPDX identifiers 2018-12-28 12:11:45 -08:00
return_address.c sh: kernel: convert to SPDX identifiers 2018-12-28 12:11:45 -08:00
setup.c sh, crash: wrap crash dumping code into crash related ifdefs 2024-02-23 17:48:23 -08:00
sh_bios.c sh: kernel: convert to SPDX identifiers 2018-12-28 12:11:45 -08:00
sh_ksyms_32.c sh: Add missing DECLARE_EXPORT() for __ashiftrt_r4_xx 2020-06-01 14:48:49 -04:00
signal_32.c sh: sanitize the flags on sigreturn 2023-03-09 10:01:59 -08:00
smp.c treewide: Trace IPIs sent via smp_send_reschedule() 2023-03-24 11:01:28 +01:00
stacktrace.c sh: stacktrace: Remove stacktrace_ops.stack() 2020-08-14 22:05:11 -04:00
swsusp.c sh: kernel: convert to SPDX identifiers 2018-12-28 12:11:45 -08:00
sys_sh32.c mm: add ksys_fadvise64_64() helper; remove in-kernel call to sys_fadvise64_64() 2018-04-02 20:16:10 +02:00
sys_sh.c mmap locking API: use coccinelle to convert mmap_sem rwsem call sites 2020-06-09 09:39:14 -07:00
syscalls_32.S sh: remove nargs from __SYSCALL 2019-03-05 21:07:13 -08:00
time.c sh: add the sh_ prefix to early platform symbols 2019-10-07 13:50:48 +02:00
topology.c drivers/base/node: consolidate node device subsystem initialization in node_dev_init() 2022-03-22 15:57:10 -07:00
traps_32.c sh: remove CONFIG_SET_FS support 2022-02-25 09:36:06 +01:00
traps.c exit: Add and use make_task_dead. 2021-12-13 12:04:45 -06:00
unwinder.c sh: kernel: convert to SPDX identifiers 2018-12-28 12:11:45 -08:00
vmcore_info.c arch, crash: move arch_crash_save_vmcoreinfo() out to file vmcore_info.c 2024-02-23 17:48:25 -08:00
vmlinux.lds.S Scheduler updates in this cycle are: 2023-02-20 17:41:08 -08:00