From: Borislav Petkov <bp@alien8.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Andy Lutomirski <luto@amacapital.net>,
Dave Young <dyoung@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Ingo Molnar <mingo@kernel.org>,
jerry_hoemann@hp.com, Jiri Kosina <jkosina@suse.cz>,
Joerg Roedel <jroedel@suse.de>, Juergen Gross <jgross@suse.com>,
Mark Salter <msalter@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
WANG Chao <chaowang@redhat.com>, x86-ml <x86@kernel.org>
Subject: [PATCH 2/5] x86/setup/crash: Remove alignment variable
Date: Thu, 15 Oct 2015 10:20:28 +0200 [thread overview]
Message-ID: <1444897231-7906-3-git-send-email-bp@alien8.de> (raw)
In-Reply-To: <1444897231-7906-1-git-send-email-bp@alien8.de>
From: Borislav Petkov <bp@suse.de>
Use a macro instead. No functionality change.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Young <dyoung@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: jerry_hoemann@hp.com
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Juergen Gross <jgross@suse.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: WANG Chao <chaowang@redhat.com>
Cc: x86-ml <x86@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
---
arch/x86/kernel/setup.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index fd9e178aa890..ea086dd8e821 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -480,6 +480,9 @@ static void __init memblock_x86_reserve_range_setup_data(void)
#ifdef CONFIG_KEXEC_CORE
+/* 16M alignment for crash kernel regions */
+#define CRASH_ALIGN (16 << 20)
+
/*
* Keep the crash kernel below this limit. On 32 bits earlier kernels
* would limit the kernel to the low 512 MiB due to mapping restrictions.
@@ -496,7 +499,6 @@ static void __init memblock_x86_reserve_range_setup_data(void)
static int __init reserve_crashkernel_low(void)
{
#ifdef CONFIG_X86_64
- const unsigned long long alignment = 16<<20; /* 16M */
unsigned long long low_base = 0, low_size = 0;
unsigned long total_low_mem;
unsigned long long base;
@@ -525,7 +527,7 @@ static int __init reserve_crashkernel_low(void)
return 0;
}
- low_base = memblock_find_in_range(low_size, 1ULL << 32, low_size, alignment);
+ low_base = memblock_find_in_range(low_size, 1ULL << 32, low_size, CRASH_ALIGN);
if (!low_base) {
pr_err("Cannot reserve %ldMB crashkernel low memory, please try smaller size.\n",
(unsigned long)(low_size >> 20));
@@ -548,7 +550,6 @@ static int __init reserve_crashkernel_low(void)
static void __init reserve_crashkernel(void)
{
- const unsigned long long alignment = 16<<20; /* 16M */
unsigned long long total_mem;
unsigned long long crash_size, crash_base;
bool high = false;
@@ -572,10 +573,10 @@ static void __init reserve_crashkernel(void)
/*
* kexec want bzImage is below CRASH_KERNEL_ADDR_MAX
*/
- crash_base = memblock_find_in_range(alignment,
+ crash_base = memblock_find_in_range(CRASH_ALIGN,
high ? CRASH_ADDR_HIGH_MAX
: CRASH_ADDR_LOW_MAX,
- crash_size, alignment);
+ crash_size, CRASH_ALIGN);
if (!crash_base) {
pr_info("crashkernel reservation failed - No suitable area found.\n");
return;
--
2.3.5
next prev parent reply other threads:[~2015-10-15 8:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 8:20 [PATCH 0/5] x86/setup/crash: Cleanup some code Borislav Petkov
2015-10-15 8:20 ` [PATCH 1/5] x86/setup: Cleanup crashkernel reservation functions Borislav Petkov
2015-10-15 8:20 ` Borislav Petkov [this message]
2015-10-15 8:20 ` [PATCH 3/5] x86/setup/crash: Cleanup some more Borislav Petkov
2015-10-15 8:20 ` [PATCH 4/5] x86/setup/crash: Check memblock_reserve() retval Borislav Petkov
2015-10-15 9:18 ` Dave Young
2015-10-15 10:03 ` Borislav Petkov
2015-10-15 8:20 ` [PATCH 5/5] kexec/crash: Say which char is the unrecognized Borislav Petkov
2015-10-15 9:14 ` [PATCH 0/5] x86/setup/crash: Cleanup some code Dave Young
2015-10-15 15:33 ` Joerg Roedel
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=1444897231-7906-3-git-send-email-bp@alien8.de \
--to=bp@alien8.de \
--cc=akpm@linux-foundation.org \
--cc=chaowang@redhat.com \
--cc=dyoung@redhat.com \
--cc=hpa@zytor.com \
--cc=jerry_hoemann@hp.com \
--cc=jgross@suse.com \
--cc=jkosina@suse.cz \
--cc=jroedel@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=msalter@redhat.com \
--cc=tglx@linutronix.de \
--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