Commit d739f190 authored by Baoquan He's avatar Baoquan He Committed by Andrew Morton
Browse files

mips, 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 mips with some adjustments.

Here use IS_ENABLED(CONFIG_CRASH_RESERVE) check to decide if compiling
in the crashkernel reservation code.

Link: https://lkml.kernel.org/r/20240124051254.67105-12-bhe@redhat.com


Signed-off-by: default avatarBaoquan 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: default avatarAndrew Morton <akpm@linux-foundation.org>
parent e3892635
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -442,8 +442,6 @@ static void __init mips_reserve_vmcore(void)
#endif
}

#ifdef CONFIG_KEXEC

/* 64M alignment for crash kernel regions */
#define CRASH_ALIGN	SZ_64M
#define CRASH_ADDR_MAX	SZ_512M
@@ -454,6 +452,9 @@ static void __init mips_parse_crashkernel(void)
	unsigned long long crash_size, crash_base;
	int ret;

	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,
@@ -489,6 +490,9 @@ static void __init request_crashkernel(struct resource *res)
{
	int ret;

	if (!IS_ENABLED(CONFIG_CRASH_RESERVE))
		return;

	if (crashk_res.start == crashk_res.end)
		return;

@@ -498,15 +502,6 @@ static void __init request_crashkernel(struct resource *res)
			(unsigned long)(resource_size(&crashk_res) >> 20),
			(unsigned long)(crashk_res.start  >> 20));
}
#else /* !defined(CONFIG_KEXEC)		*/
static void __init mips_parse_crashkernel(void)
{
}

static void __init request_crashkernel(struct resource *res)
{
}
#endif /* !defined(CONFIG_KEXEC)  */

static void __init check_kernel_sections_mem(void)
{