Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753250AbdFVLOq (ORCPT ); Thu, 22 Jun 2017 07:14:46 -0400 Received: from terminus.zytor.com ([65.50.211.136]:50193 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753212AbdFVLOp (ORCPT ); Thu, 22 Jun 2017 07:14:45 -0400 Date: Thu, 22 Jun 2017 04:10:03 -0700 From: tip-bot for Jiri Bohac Message-ID: Cc: ebiederm@xmission.com, torvalds@linux-foundation.org, peterz@infradead.org, yinghai@kernel.org, jbohac@suse.cz, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, keescook@chromium.org, tglx@linutronix.de Reply-To: ebiederm@xmission.com, torvalds@linux-foundation.org, yinghai@kernel.org, peterz@infradead.org, jbohac@suse.cz, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, keescook@chromium.org, tglx@linutronix.de In-Reply-To: <20170616161602.2r7birrf2y3ylv6v@dwarf.suse.cz> References: <20170616161602.2r7birrf2y3ylv6v@dwarf.suse.cz> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/boot] x86/debug: Extend the lower bound of crash kernel low reservations Git-Commit-ID: fe2d48b805d01e14ddb8144de01de43171eb516f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1997 Lines: 51 Commit-ID: fe2d48b805d01e14ddb8144de01de43171eb516f Gitweb: http://git.kernel.org/tip/fe2d48b805d01e14ddb8144de01de43171eb516f Author: Jiri Bohac AuthorDate: Fri, 16 Jun 2017 18:16:02 +0200 Committer: Ingo Molnar CommitDate: Thu, 22 Jun 2017 11:10:23 +0200 x86/debug: Extend the lower bound of crash kernel low reservations The following change in 2013: 0212f9159694 ("x86: Add Crash kernel low reservation") ... introduced reserve_crashkernel_low(). This function is used to reserve crash kernel memory either if crashkernel=size,low is given on the command line or if the region reserved by reserve_crashkernel is entirely above 4G. reserve_crashkernel_low() tries to find a block of 'low_size' bytes. But there seems to be no good reason to restrict the lower bound of the range to 'low_size'. Make memblock_find_in_range() search from the start of memory. Signed-off-by: Jiri Bohac Cc: Eric Biederman Cc: H. Peter Anvin Cc: Kees Cook Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Yinghai Lu Link: http://lkml.kernel.org/r/20170616161602.2r7birrf2y3ylv6v@dwarf.suse.cz Signed-off-by: Ingo Molnar --- arch/x86/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 0b4d3c6..848d048 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -503,7 +503,7 @@ static int __init reserve_crashkernel_low(void) return 0; } - low_base = memblock_find_in_range(low_size, 1ULL << 32, low_size, CRASH_ALIGN); + low_base = memblock_find_in_range(0, 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));