Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752294AbdFPQQF (ORCPT ); Fri, 16 Jun 2017 12:16:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:45693 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751068AbdFPQQD (ORCPT ); Fri, 16 Jun 2017 12:16:03 -0400 Date: Fri, 16 Jun 2017 18:16:02 +0200 From: Jiri Bohac To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Yinghai Lu Cc: linux-kernel@vger.kernel.org Subject: [PATCH] x86: fix lower bound of crash kernel low reservation Message-ID: <20170616161602.2r7birrf2y3ylv6v@dwarf.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1155 Lines: 31 Commit 0212f9159694 (x86: Add Crash kernel low reservation) introduced reserve_crashkernel_low. This 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 --- diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index f81823695014..65622f07e633 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)); -- Jiri Bohac SUSE Labs, Prague, Czechia