[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240119145241.769622-15-bhe@redhat.com>
Date: Fri, 19 Jan 2024 22:52:41 +0800
From: Baoquan He <bhe@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: kexec@...ts.infradead.org,
x86@...nel.org,
linux-arm-kernel@...ts.infradead.org,
linuxppc-dev@...ts.ozlabs.org,
linux-s390@...r.kernel.org,
linux-sh@...r.kernel.org,
linux-mips@...r.kernel.org,
linux-riscv@...ts.infradead.org,
loongarch@...ts.linux.dev,
akpm@...ux-foundation.org,
ebiederm@...ssion.com,
hbathini@...ux.ibm.com,
piliu@...hat.com,
viro@...iv.linux.org.uk,
Baoquan He <bhe@...hat.com>
Subject: [PATCH v2 14/14] loongarch, crash: wrap crash dumping code into crash related ifdefs
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 loongarch with some adjustments.
Here 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.
Signed-off-by: Baoquan He <bhe@...hat.com>
---
arch/loongarch/kernel/setup.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c
index d183a745fb85..61f88dd97947 100644
--- a/arch/loongarch/kernel/setup.c
+++ b/arch/loongarch/kernel/setup.c
@@ -258,11 +258,13 @@ static void __init arch_reserve_vmcore(void)
static void __init arch_parse_crashkernel(void)
{
-#ifdef CONFIG_KEXEC
int ret;
unsigned long long total_mem;
unsigned long long crash_base, crash_size;
+ if (!IS_ENABLED(CONFIG_CRASH_RESERVE))
+ return;
+
total_mem = memblock_phys_mem_size();
ret = parse_crashkernel(boot_command_line, total_mem,
&crash_size, &crash_base,
@@ -283,7 +285,6 @@ static void __init arch_parse_crashkernel(void)
crashk_res.start = crash_base;
crashk_res.end = crash_base + crash_size - 1;
-#endif
}
static void __init fdt_setup(void)
@@ -468,7 +469,7 @@ static void __init resource_init(void)
request_resource(res, &bss_resource);
}
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_CRASH_RESERVE
if (crashk_res.start < crashk_res.end) {
insert_resource(&iomem_resource, &crashk_res);
pr_info("Reserving %ldMB of memory at %ldMB for crashkernel\n",
--
2.41.0
Powered by blists - more mailing lists