sh, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC
authorBaoquan He <bhe@redhat.com>
Fri, 8 Dec 2023 07:30:35 +0000 (15:30 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 13 Dec 2023 01:20:18 +0000 (17:20 -0800)
The select of KEXEC for CRASH_DUMP in kernel/Kconfig.kexec will be
dropped, then compiling errors will be triggered if below config
items are set:

===
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y
===

Here, change the dependency of building kexec_core related object files,
and the ifdeffery on SuperH from CONFIG_KEXEC to CONFIG_KEXEC_CORE.

Link: https://lkml.kernel.org/r/20231208073036.7884-5-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Eric DeVolder <eric_devolder@yahoo.com>
Cc: Ignat Korchagin <ignat@cloudflare.com>
Cc: kernel test robot <lkp@intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/sh/include/asm/kexec.h
arch/sh/kernel/Makefile
arch/sh/kernel/reboot.c
arch/sh/kernel/setup.c

index 927d80ba2332a73dd5ebfb3760b2b2b5137c86bb..76631714673ca8540985b0a1c5cd4bea18ad697c 100644 (file)
@@ -28,7 +28,7 @@
 /* The native architecture */
 #define KEXEC_ARCH KEXEC_ARCH_SH
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 /* arch/sh/kernel/machine_kexec.c */
 void reserve_crashkernel(void);
 
@@ -67,6 +67,6 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
 }
 #else
 static inline void reserve_crashkernel(void) { }
-#endif /* CONFIG_KEXEC */
+#endif /* CONFIG_KEXEC_CORE */
 
 #endif /* __ASM_SH_KEXEC_H */
index 69cd9ac4b2ab8a55c290a42d52bb4cfc0f4926ba..2d7e70537de04c9b731de0ffcadc807c62238754 100644 (file)
@@ -33,7 +33,7 @@ obj-$(CONFIG_SMP)             += smp.o
 obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o
 obj-$(CONFIG_KGDB)             += kgdb.o
 obj-$(CONFIG_MODULES)          += sh_ksyms_32.o module.o
-obj-$(CONFIG_KEXEC)            += machine_kexec.o relocate_kernel.o
+obj-$(CONFIG_KEXEC_CORE)       += machine_kexec.o relocate_kernel.o
 obj-$(CONFIG_CRASH_DUMP)       += crash_dump.o
 obj-$(CONFIG_STACKTRACE)       += stacktrace.o
 obj-$(CONFIG_IO_TRAPPED)       += io_trapped.o
index e8eeedc9b1822d5963cb2df4ce17439835f88e81..1de006b1c3393463632dd66d9a929c9a30d166ef 100644 (file)
@@ -63,7 +63,7 @@ struct machine_ops machine_ops = {
        .shutdown       = native_machine_shutdown,
        .restart        = native_machine_restart,
        .halt           = native_machine_halt,
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
        .crash_shutdown = native_machine_crash_shutdown,
 #endif
 };
@@ -88,7 +88,7 @@ void machine_halt(void)
        machine_ops.halt();
 }
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 void machine_crash_shutdown(struct pt_regs *regs)
 {
        machine_ops.crash_shutdown(regs);
index 3d80515298d268e77f4684bb37782c1c589fc182..d3175f09b3aad9579fc16ceceb800a3d4af7320d 100644 (file)
@@ -220,7 +220,7 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
        request_resource(res, &code_resource);
        request_resource(res, &data_resource);
        request_resource(res, &bss_resource);
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
        request_resource(res, &crashk_res);
 #endif