sh, crash: wrap crash dumping code into crash related ifdefs
authorBaoquan He <bhe@redhat.com>
Wed, 24 Jan 2024 05:12:50 +0000 (13:12 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 24 Feb 2024 01:48:23 +0000 (17:48 -0800)
Now crash codes under kernel/ folder has been split out from kexec
code, crash dumping can be separated from kexec reboot in config
items on SuperH with some adjustments.

Wrap up crash dumping codes with CONFIG_CRASH_DUMP ifdeffery, and use
IS_ENABLED(CONFIG_CRASH_RESERVE) check to decide if compiling in the
crashkernel reservation code.

Link: https://lkml.kernel.org/r/20240124051254.67105-11-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Hari Bathini <hbathini@linux.ibm.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>
arch/sh/kernel/machine_kexec.c
arch/sh/kernel/setup.c

index fa3a7b36190a2acfb4e64d724afad8e33a88f3e2..8daa8a6e6fa683bcbc0f0895ac4eb089ccdc0943 100644 (file)
@@ -153,6 +153,9 @@ void __init reserve_crashkernel(void)
        unsigned long long crash_size, crash_base;
        int ret;
 
+       if (!IS_ENABLED(CONFIG_CRASH_RESERVE))
+               return;
+
        ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(),
                        &crash_size, &crash_base, NULL, NULL);
        if (ret == 0 && crash_size > 0) {
index d3175f09b3aad9579fc16ceceb800a3d4af7320d..620e5cf8ae1e748db41e28a103db678b1bb60c69 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_CORE
+#ifdef CONFIG_CRASH_RESERVE
        request_resource(res, &crashk_res);
 #endif