[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201031074437.168008-2-chenzhou10@huawei.com>
Date: Sat, 31 Oct 2020 15:44:30 +0800
From: Chen Zhou <chenzhou10@...wei.com>
To: <tglx@...utronix.de>, <mingo@...hat.com>, <dyoung@...hat.com>,
<bhe@...hat.com>, <catalin.marinas@....com>, <will@...nel.org>,
<corbet@....net>, <John.P.donnelly@...cle.com>,
<bhsharma@...hat.com>, <prabhakar.pkin@...il.com>
CC: <horms@...ge.net.au>, <robh+dt@...nel.org>, <arnd@...db.de>,
<nsaenzjulienne@...e.de>, <james.morse@....com>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<kexec@...ts.infradead.org>, <linux-doc@...r.kernel.org>,
<chenzhou10@...wei.com>, <xiexiuqi@...wei.com>,
<guohanjun@...wei.com>, <huawei.libin@...wei.com>,
<wangkefeng.wang@...wei.com>,
John Donnelly <John.p.donnelly@...cle.com>
Subject: [PATCH v13 1/8] x86: kdump: replace the hard-coded alignment with macro CRASH_ALIGN
Move CRASH_ALIGN to header asm/kexec.h and replace the hard-coded
alignment with macro CRASH_ALIGN in function reserve_crashkernel().
Suggested-by: Dave Young <dyoung@...hat.com>
Signed-off-by: Chen Zhou <chenzhou10@...wei.com>
Tested-by: John Donnelly <John.p.donnelly@...cle.com>
---
arch/x86/include/asm/kexec.h | 3 +++
arch/x86/kernel/setup.c | 5 +----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
index 6802c59e8252..8cf9d3fd31c7 100644
--- a/arch/x86/include/asm/kexec.h
+++ b/arch/x86/include/asm/kexec.h
@@ -18,6 +18,9 @@
# define KEXEC_CONTROL_CODE_MAX_SIZE 2048
+/* 2M alignment for crash kernel regions */
+#define CRASH_ALIGN SZ_16M
+
#ifndef __ASSEMBLY__
#include <linux/string.h>
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 84f581c91db4..bf373422dc8a 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -395,9 +395,6 @@ static void __init memblock_x86_reserve_range_setup_data(void)
#ifdef CONFIG_KEXEC_CORE
-/* 16M alignment for crash kernel regions */
-#define CRASH_ALIGN SZ_16M
-
/*
* Keep the crash kernel below this limit.
*
@@ -515,7 +512,7 @@ static void __init reserve_crashkernel(void)
} else {
unsigned long long start;
- start = memblock_phys_alloc_range(crash_size, SZ_1M, crash_base,
+ start = memblock_phys_alloc_range(crash_size, CRASH_ALIGN, crash_base,
crash_base + crash_size);
if (start != crash_base) {
pr_info("crashkernel reservation failed - memory is in use.\n");
--
2.20.1
Powered by blists - more mailing lists