linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-s390@vger.kernel.org, Baoquan He <bhe@redhat.com>,
	piliu@redhat.com, linux-sh@vger.kernel.org, x86@kernel.org,
	kexec@lists.infradead.org, linux-mips@vger.kernel.org,
	ebiederm@xmission.com, loongarch@lists.linux.dev,
	hbathini@linux.ibm.com, linux-riscv@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org, akpm@linux-foundation.org,
	linux-arm-kernel@lists.infradead.org, viro@zeniv.linux.org.uk
Subject: [PATCH v2 14/14] loongarch, crash: wrap crash dumping code into crash related ifdefs
Date: Fri, 19 Jan 2024 22:52:41 +0800	[thread overview]
Message-ID: <20240119145241.769622-15-bhe@redhat.com> (raw)
In-Reply-To: <20240119145241.769622-1-bhe@redhat.com>

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@redhat.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


  parent reply	other threads:[~2024-01-19 15:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19 14:52 [PATCH v2 00/14] Split crash out from kexec and clean up related config items Baoquan He
2024-01-19 14:52 ` [PATCH v2 01/14] kexec: split crashkernel reservation code out from crash_core.c Baoquan He
2024-02-21 17:29   ` Sourabh Jain
2024-02-21 20:12     ` Andrew Morton
2024-01-19 14:52 ` [PATCH v2 02/14] crash: split vmcoreinfo exporting " Baoquan He
2024-02-21 17:37   ` Sourabh Jain
2024-02-22  7:57     ` Baoquan He
2024-01-19 14:52 ` [PATCH v2 03/14] crash: remove dependency of FA_DUMP on CRASH_DUMP Baoquan He
2024-01-19 14:52 ` [PATCH v2 04/14] crash: split crash dumping code out from kexec_core.c Baoquan He
2024-01-19 14:52 ` [PATCH v2 05/14] crash: clean up kdump related config items Baoquan He
2024-01-19 14:52 ` [PATCH v2 06/14] x86, crash: wrap crash dumping code into crash related ifdefs Baoquan He
2024-01-19 14:52 ` [PATCH v2 07/14] arm64, " Baoquan He
2024-01-19 14:52 ` [PATCH v2 08/14] ppc, crash: enforce KEXEC and KEXEC_FILE to select CRASH_DUMP Baoquan He
2024-01-19 14:52 ` [PATCH v2 09/14] s390, crash: wrap crash dumping code into crash related ifdefs Baoquan He
2024-01-19 14:52 ` [PATCH v2 10/14] sh, " Baoquan He
2024-01-19 14:52 ` [PATCH v2 11/14] arm, " Baoquan He
2024-01-20 12:13   ` kernel test robot
2024-01-21  1:55     ` Baoquan He
2024-01-20 13:58   ` kernel test robot
2024-01-19 14:52 ` [PATCH v2 12/14] mips, " Baoquan He
2024-01-19 14:52 ` [PATCH v2 13/14] riscv, " Baoquan He
2024-01-19 14:52 ` Baoquan He [this message]
2024-02-02  5:23 ` [PATCH v2 00/14] Split crash out from kexec and clean up related config items Hari Bathini
2024-02-04  3:26   ` Baoquan He
2024-02-21  5:45     ` Hari Bathini
2024-02-21 13:44       ` Baoquan He
2024-02-21 20:57       ` Andrew Morton
2024-02-22  5:17         ` Hari Bathini
2024-02-22 21:29           ` Andrew Morton
2024-02-23  5:41             ` Hari Bathini
2024-02-22  7:07         ` Baoquan He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240119145241.769622-15-bhe@redhat.com \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=hbathini@linux.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=loongarch@lists.linux.dev \
    --cc=piliu@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).