Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp452200img; Fri, 22 Mar 2019 01:23:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2WyUW791G62rJmIc7NFwIBfEazvzoBxtWlTUVWpELmygIaUSbZWbHRp606lqXS2pSIzmc X-Received: by 2002:a62:58c7:: with SMTP id m190mr7919129pfb.4.1553243006699; Fri, 22 Mar 2019 01:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553243006; cv=none; d=google.com; s=arc-20160816; b=silRjZbIK7f5p+WWvzT507e3C76hYCQ2D+MTCa1SbVEdwAWtq6esozdbtwFCknmNMs b/pNtFEO/lOBvIrdUShWhPKhcLmNdekZ6OsXgggR7KlphD7Khs2uEGepqRF0V+JflmD2 c8BZElHY5h9L/q4KQ7xGm9vVsRygQvFo81FYGyoOPkIl8uiPIygAVb4RM8WjsbHqBki1 A9y5jDG3m4djDFGgk4NosZvvDC0V6yA3+w+wPQZ9vFMa++PApAGHro5YOZrpuA1Xcgtl 6qXJuS7/civ2xoVv1VPGebOzYhQM/WBRmM05PyF/pf4mdOv3+24q31GU2LRV9+idC42h g+tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=M97oeYGMr0ydSJBdkKrshGEnK84453qA20ivfO5zkJ8=; b=LzxEzTJCQ9dL1kkhh1q2BlXKrOpUVfROhpVRCAkhPOqOgXAjWEFbaSXkAERb0pIgi3 fq2cFvJVXMyYHAY2bAafQdpyEsySqrHxbLLxQMCmJvljcsFPO9AZu4rI6tjx6VjqHpkT o1c+mu+wnVuRci8XBUwXA28rCs7dofgRF3NW84qRLxBBWrO5+9BT3nOQb7nODJsddby/ LLSHWXr1K6IWaUZwmOurhknui0wFyjQR+7wc/17E9d/2c5FcoSnWLQojUg+gxZ2bmbz0 +LHj3KZrIi9Mv2w6Emt8bLcWIvX82Me6TgKJZvG4UkM+HFfcSUDTBWQa6c0hnINHSvD7 fnWg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d41si6758635pla.307.2019.03.22.01.23.11; Fri, 22 Mar 2019 01:23:26 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727703AbfCVIW1 (ORCPT + 99 others); Fri, 22 Mar 2019 04:22:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10469 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727646AbfCVIW0 (ORCPT ); Fri, 22 Mar 2019 04:22:26 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F2B8C057F3E; Fri, 22 Mar 2019 08:22:26 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-13-25.pek2.redhat.com [10.72.13.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7EC15D9C5; Fri, 22 Mar 2019 08:22:20 +0000 (UTC) Date: Fri, 22 Mar 2019 16:22:16 +0800 From: Dave Young To: Pingfan Liu Cc: Borislav Petkov , 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 Subject: Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr Message-ID: <20190322082216.GA23356@dhcp-128-65.nay.redhat.com> References: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 22 Mar 2019 08:22:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pingfan, Thanks for the effort, On 03/01/19 at 11:19am, Pingfan Liu wrote: > 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 This way looks good to me, I will do some testing with old kexec-tools, Once testing done I can take up this again and repost later with some documentation update. Also will split to 2 patches one to drop the old limitation, another for the fallback. Thanks Dave