Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp154567imb; Thu, 28 Feb 2019 19:20:08 -0800 (PST) X-Google-Smtp-Source: AHgI3IZxb4OQD2ZF5SmmMwSjQfWuR9lus3Ky27nIWpyJV8pUDLcC9orTs9g8DK2rrAiO8RAY6+x/ X-Received: by 2002:a62:b608:: with SMTP id j8mr3293992pff.183.1551410408719; Thu, 28 Feb 2019 19:20:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551410408; cv=none; d=google.com; s=arc-20160816; b=ClqddPLPI8RKvcVNcc8a2z0qLi66zIsJ58GltsUpZLSybkSXxEjuEC6TyKlU+lPuBU 6ZvrgruTiNtN4o7sgpdZ70MP2/NrKDIPN7YtTehCOX08ierTsl1U3B6aDBtSI6d4A870 bLUJU5ROZ+5u/p9xUrmEJkomGmVuEn6pDcu4zC5l9J5HhK5tWc4MVnu+68e/paQZY0ts m1c9EmnTm1KhisC8itY4kw7W3u1cFER5nZcfQgTS/vuFuvbSpWBUBK0ubhlE4y7fy4Uh THSRkrkclTrc8SGgbM7+MPnj1kIiuEzgorKmRRZTI4BThAO+/4fP0lZfro8Yznrn/2fc MJjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yHca5tTZi2E0JqjIPlb4MJ/8nRUQ1/7scXPzMTiSAV0=; b=C8OV3Gqmn6GhY9Aj0oLglJBUVRZ40zK2Zmj2Yg6WjbTTLInnC1eP2PBHL72aXbYCVm Wy3Hl1NW8ZFuWWyvf6ruq0s2IgJhJ+1nizTB6KvB13yyn6KiLy30nT7gUV0+uD9e8BZD byw3tgSWfG3dxjnMc0Gj38NQoI1aI00Kqj4+H0APldejMzQkaLbHtrX4zy8qQs7bkrA9 BdMT+94ggEiSx4ORsRRilBv8t1WSziD56fdUuN/Cj0G3WZDlpMuD3kDJtlA4XiSOv1Di wpsgIoZS5b/QouMzxBW4umgdE8IsxPfuqz4fCPuNRfzCP4EuUh+tpDzyJNL/KeyOL2Ou rarA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GKetQsyD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si16299651pgj.217.2019.02.28.19.19.53; Thu, 28 Feb 2019 19:20:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GKetQsyD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728005AbfCADT1 (ORCPT + 99 others); Thu, 28 Feb 2019 22:19:27 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:37483 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbfCADT1 (ORCPT ); Thu, 28 Feb 2019 22:19:27 -0500 Received: by mail-it1-f193.google.com with SMTP id z124so19283958itc.2 for ; Thu, 28 Feb 2019 19:19:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yHca5tTZi2E0JqjIPlb4MJ/8nRUQ1/7scXPzMTiSAV0=; b=GKetQsyDzRqUNPmAt822eTLcyXYX27MKkPexbmAQ5fJClK9RpoYLW2zOCSVLvxPg5R aFZmO+kHK2P19fN7WaDZV9xZGxJ3BMkLXV8IVWwpuDGSqu2bnabcF2Ua4g3dPN71P+gi 0m1J9jfauPiZFrX9LGXUf/xy+++ENlzGB8oIH925IG2FSILvkVT/jrPxD6vQvmlrxvFz SIopVF4KCzdmN16Yme0fzjZdJ4K2xpwmnwS4hOvr21VkaZhQmQyo6+My4JzYz822i3yu 1Nt52v+POpcQfTvlGprmRaR109C7NMIBhTbRt/TbxHXUzilcZJ7D/puypKSnRU7+5/+T zU/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yHca5tTZi2E0JqjIPlb4MJ/8nRUQ1/7scXPzMTiSAV0=; b=BvCgO97741iYG/DBNOwrE/OMgbSjlnB2IdKNpY2+6sKnqArIZ5+NJwulqQWx9NHUhe FYXHORVHh5VGZvajvmQq+GXgRD77MukhoX/b5WzlUCt/qDT8Zpw3ImOGwM6FVzi8UAFI 2PVnZVFVpkgLTDEPynS2R9Ny758D4nC4BXQgeQHI8UfLqYOJoOMUg07XofXUgeX/fu5A k3fQqVrFYAJRjoHEn9aSwQDtkSE28HOanbp7vHPIc2urwaXWfBx/uY9br6OQmKqi/cPf 7OQEab5DMlPlL1ydJib9p0fhCAdv1ds8zrsBledRbq/ZoLzW3lSHCwXVAthJ9Qm68NHX o3Yw== X-Gm-Message-State: APjAAAUVgcdJGa5FPkGNnUjM807ASbr4WYRhjNt6jzBIOMqMMVX1xBsv 5OVsTUMZjz56lDZZwvKQwHoBanW18XtEn9Qv6g== X-Received: by 2002:a05:660c:252:: with SMTP id t18mr2007311itk.173.1551410366254; Thu, 28 Feb 2019 19:19:26 -0800 (PST) MIME-Version: 1.0 References: <20190215102458.GD10433@zn.tnic> <20190218014820.GA10711@dhcp-128-65.nay.redhat.com> <20190220083241.GA3447@zn.tnic> <20190220094146.GA8597@dhcp-128-65.nay.redhat.com> <20190221171321.GD12997@zn.tnic> <20190222021101.GA11654@dhcp-128-65.nay.redhat.com> <20190222084241.GC8380@suse.de> <20190222130026.GA30766@zn.tnic> <20190225110043.GA5884@suse.de> <20190225111216.GA9276@dhcp-128-65.nay.redhat.com> <20190225113003.GE26145@zn.tnic> In-Reply-To: From: Pingfan Liu Date: Fri, 1 Mar 2019 11:19:15 +0800 Message-ID: Subject: Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr To: Borislav Petkov Cc: Dave Young , Joerg Roedel , Baoquan He , Jerry Hoemann , x86@kernel.org, Randy Dunlap , kexec@lists.infradead.org, LKML , Mike Rapoport , Andrew Morton , Yinghai Lu , vgoyal@redhat.com, iommu@lists.linux-foundation.org, konrad.wilk@oracle.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 1, 2019 at 11:04 AM Pingfan Liu wrote: > > Hi Borislav, > > Do you think the following patch is good at present? > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c > index 81f9d23..9213073 100644 > --- a/arch/x86/kernel/setup.c > +++ b/arch/x86/kernel/setup.c > @@ -460,7 +460,7 @@ static void __init > memblock_x86_reserve_range_setup_data(void) > # define CRASH_ADDR_LOW_MAX (512 << 20) > # define CRASH_ADDR_HIGH_MAX (512 << 20) > #else > -# define CRASH_ADDR_LOW_MAX (896UL << 20) > +# define CRASH_ADDR_LOW_MAX (1 << 32) > # define CRASH_ADDR_HIGH_MAX MAXMEM > #endif > Or patch lools like: diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 3d872a5..ed0def5 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -459,7 +459,7 @@ static void __init memblock_x86_reserve_range_setup_data(void) # define CRASH_ADDR_LOW_MAX (512 << 20) # define CRASH_ADDR_HIGH_MAX (512 << 20) #else -# define CRASH_ADDR_LOW_MAX (896UL << 20) +# define CRASH_ADDR_LOW_MAX (1 << 32) # define CRASH_ADDR_HIGH_MAX MAXMEM #endif @@ -551,6 +551,15 @@ static void __init reserve_crashkernel(void) high ? CRASH_ADDR_HIGH_MAX : CRASH_ADDR_LOW_MAX, crash_size, CRASH_ALIGN); +#ifdef CONFIG_X86_64 + /* + * crashkernel=X reserve below 4G fails? Try MAXMEM + */ + if (!high && !crash_base) + crash_base = memblock_find_in_range(CRASH_ALIGN, + CRASH_ADDR_HIGH_MAX, + crash_size, CRASH_ALIGN); +#endif which tries 0-4G, the fall back to 4G above > For documentation, I will send another patch to improve the description. > > Thanks, > Pingfan > > On Mon, Feb 25, 2019 at 7:30 PM Borislav Petkov wrote: > > > > On Mon, Feb 25, 2019 at 07:12:16PM +0800, Dave Young wrote: > > > If we move to high as default, it will allocate 160M high + 256M low. It > > > > We won't move to high by default - we will *fall* back to high if the > > default allocation fails. > > > > > To make the process less fragile maybe we can remove the 896M limitation > > > and only try <4G then go to high. > > > > Sure, the more robust for the user, the better. > > > > -- > > Regards/Gruss, > > Boris. > > > > Good mailing practices for 400: avoid top-posting and trim the reply.