Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6974737pxb; Wed, 17 Feb 2021 20:18:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9pNryOG8+sM06BvJ5KFe4FBtTR0BM5fC5XRSKilRovtvieXPOJJp7Al0REMcSVENo6Cjy X-Received: by 2002:aa7:db17:: with SMTP id t23mr2074365eds.310.1613621935347; Wed, 17 Feb 2021 20:18:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613621935; cv=none; d=google.com; s=arc-20160816; b=S9wI4KBT7L7vickL7Zf5qp4mG0ZGloCpnaL/hqr3bXQEV217s8l7oryVFOxQLtTyR3 WzWI1U3gDmK12UzV1NwYHbUHM9T16OqD5U4qlZkGlKY2GCLMyDBC5km7NqzWXSdXiiFD sdTB996Q5fIS88lnd8cnDbBptFleYwUCGgGId/KmGkLcyxhq5hnvCKtqzxBZx72z9bsW kmGYCDiFMw5vdAIb+dnlhKH9YwPYJmz2oXKwIVQrKlFd5TVONWILbHNpEJ7lFbDRe9/c L+GakyW/wkRSoCQnp3IVxRh43Mi0VQ8OPOrmU/lTc9b8Pz6010BTWzL1rokpY5nUx+5r zIyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=emJvmHO6K5DoKcle3XfGbvke6XPq47tbyoxFu4GbpOg=; b=xq/DsWWJ3iiaNNsvzK5M321BZn+B9YN1vNz8ZhMZVXtBBosQh2UBBb0sEpvkQVH1NX 4mYX2DKwVAzaEnnB265tYiztYrVMdBDjHSdMt6jue52lXnHmenyC0c2AagHfWAIgKILb mutes9qp9h018v0dgYLfSfZthevjDxPmRNas32fgnHeLIV384HYCCN890r/xM9CPr7bD xu7ennKJjsIKJWJiQ6tPH2YaIDDAMZQbOdOyA0mPY16IcaV9Yl+shRB/tsSq6B150fve f8zvJecBpub62zDHGZk5Ec2LoEiRf8k0MWtwHU6gxS2sjvNw5e/8YNXuWPCqMJnca48n T3XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V1fJCLTJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q19si2921242edv.67.2021.02.17.20.18.31; Wed, 17 Feb 2021 20:18:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V1fJCLTJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229752AbhBREPx (ORCPT + 99 others); Wed, 17 Feb 2021 23:15:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44047 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbhBREPt (ORCPT ); Wed, 17 Feb 2021 23:15:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613621662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=emJvmHO6K5DoKcle3XfGbvke6XPq47tbyoxFu4GbpOg=; b=V1fJCLTJID2aqb8rKZWsbM8F0gf4muNo4JH3DlgXN92NN5ZJ6+9bhv3Bmhcm7lO6RI1vQY sY842zaD8wLlyBOnkVLqcpnTI9Nnzhzox8b7RHKdJPSMI6uBy7Jhk7fq4c5Wxxhuep0Rif 5uYbI1BSp2p6Yj2QK9FJHrU99jsHwSA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-401-wauykghLNGe1NIrrLr8z8Q-1; Wed, 17 Feb 2021 23:14:18 -0500 X-MC-Unique: wauykghLNGe1NIrrLr8z8Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 334E11020C22; Thu, 18 Feb 2021 04:14:15 +0000 (UTC) Received: from localhost (ovpn-12-112.pek2.redhat.com [10.72.12.112]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C7E7A10016F0; Thu, 18 Feb 2021 04:14:10 +0000 (UTC) Date: Thu, 18 Feb 2021 12:14:07 +0800 From: Baoquan He To: Chen Zhou Cc: mingo@redhat.com, tglx@linutronix.de, rppt@kernel.org, dyoung@redhat.com, catalin.marinas@arm.com, will@kernel.org, nsaenzjulienne@suse.de, corbet@lwn.net, John.P.donnelly@oracle.com, prabhakar.pkin@gmail.com, horms@verge.net.au, robh+dt@kernel.org, arnd@arndb.de, james.morse@arm.com, xiexiuqi@huawei.com, guohanjun@huawei.com, huawei.libin@huawei.com, wangkefeng.wang@huawei.com, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v14 04/11] x86: kdump: move xen_pv_domain() check and insert_resource() to setup_arch() Message-ID: <20210218041259.GG2871@MiWiFi-R3L-srv> References: <20210130071025.65258-1-chenzhou10@huawei.com> <20210130071025.65258-5-chenzhou10@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210130071025.65258-5-chenzhou10@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/30/21 at 03:10pm, Chen Zhou wrote: > We will make the functions reserve_crashkernel() as generic, the > xen_pv_domain() check in reserve_crashkernel() is relevant only to > x86, the same as insert_resource() in reserve_crashkernel[_low](). > So move xen_pv_domain() check and insert_resource() to setup_arch() > to keep them in x86. > > Suggested-by: Mike Rapoport > Signed-off-by: Chen Zhou > Tested-by: John Donnelly > --- > arch/x86/kernel/setup.c | 19 +++++++++++-------- > 1 file changed, 11 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c > index 086a04235be4..5d676efc32f6 100644 > --- a/arch/x86/kernel/setup.c > +++ b/arch/x86/kernel/setup.c > @@ -454,7 +454,6 @@ static int __init reserve_crashkernel_low(void) > > crashk_low_res.start = low_base; > crashk_low_res.end = low_base + low_size - 1; > - insert_resource(&iomem_resource, &crashk_low_res); > #endif > return 0; > } > @@ -478,11 +477,6 @@ static void __init reserve_crashkernel(void) > high = true; > } > > - if (xen_pv_domain()) { > - pr_info("Ignoring crashkernel for a Xen PV domain\n"); > - return; > - } > - > /* 0 means: find the address automatically */ > if (!crash_base) { > /* > @@ -529,7 +523,6 @@ static void __init reserve_crashkernel(void) > > crashk_res.start = crash_base; > crashk_res.end = crash_base + crash_size - 1; > - insert_resource(&iomem_resource, &crashk_res); > } > #else > static void __init reserve_crashkernel(void) > @@ -1151,7 +1144,17 @@ void __init setup_arch(char **cmdline_p) > * Reserve memory for crash kernel after SRAT is parsed so that it > * won't consume hotpluggable memory. > */ > - reserve_crashkernel(); > + if (xen_pv_domain()) > + pr_info("Ignoring crashkernel for a Xen PV domain\n"); > + else { > + reserve_crashkernel(); > +#ifdef CONFIG_KEXEC_CORE > + if (crashk_res.end > crashk_res.start) > + insert_resource(&iomem_resource, &crashk_res); > + if (crashk_low_res.end > crashk_low_res.start) > + insert_resource(&iomem_resource, &crashk_low_res); > +#endif Acked-by: Baoquan He > + } > > memblock_find_dma_reserve(); > > -- > 2.20.1 >