From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A17C3C433E6 for ; Thu, 4 Feb 2021 16:21:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7220464DEC for ; Thu, 4 Feb 2021 16:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237135AbhBDQVT (ORCPT ); Thu, 4 Feb 2021 11:21:19 -0500 Received: from mx2.suse.de ([195.135.220.15]:55082 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237756AbhBDQU4 (ORCPT ); Thu, 4 Feb 2021 11:20:56 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 52306ABD5; Thu, 4 Feb 2021 16:20:14 +0000 (UTC) Message-ID: Subject: Re: [PATCH v14 07/11] arm64: kdump: introduce some macroes for crash kernel reservation From: Nicolas Saenz Julienne To: Chen Zhou , mingo@redhat.com, tglx@linutronix.de, rppt@kernel.org, dyoung@redhat.com, bhe@redhat.com, catalin.marinas@arm.com, will@kernel.org, corbet@lwn.net, John.P.donnelly@oracle.com, bhsharma@redhat.com, prabhakar.pkin@gmail.com Cc: 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, kexec@lists.infradead.org Date: Thu, 04 Feb 2021 17:20:11 +0100 In-Reply-To: <20210130071025.65258-8-chenzhou10@huawei.com> References: <20210130071025.65258-1-chenzhou10@huawei.com> <20210130071025.65258-8-chenzhou10@huawei.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-LxuFd/trEQUkJJT19YKS" User-Agent: Evolution 3.38.3 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-LxuFd/trEQUkJJT19YKS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Chen, On Sat, 2021-01-30 at 15:10 +0800, Chen Zhou wrote: > Introduce macro CRASH_ALIGN for alignment, macro CRASH_ADDR_LOW_MAX > for upper bound of low crash memory, macro CRASH_ADDR_HIGH_MAX for > upper bound of high crash memory, use macroes instead. >=20 > Besides, keep consistent with x86, use CRASH_ALIGN as the lower bound > of crash kernel reservation. >=20 > Signed-off-by: Chen Zhou > Tested-by: John Donnelly > --- > =C2=A0arch/arm64/include/asm/kexec.h | 6 ++++++ > =C2=A0arch/arm64/mm/init.c | 6 +++--- > =C2=A02 files changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexe= c.h > index d24b527e8c00..3f6ecae0bc68 100644 > --- a/arch/arm64/include/asm/kexec.h > +++ b/arch/arm64/include/asm/kexec.h > @@ -25,6 +25,12 @@ > =C2=A0 >=20 > =C2=A0#define KEXEC_ARCH KEXEC_ARCH_AARCH64 > =C2=A0 >=20 > +/* 2M alignment for crash kernel regions */ > +#define CRASH_ALIGN SZ_2M > + > +#define CRASH_ADDR_LOW_MAX arm64_dma_phys_limit I wonder if you could use 'ARCH_LOW_ADDRESS_LIMIT', instead of creating a n= ew define. > +#define CRASH_ADDR_HIGH_MAX MEMBLOCK_ALLOC_ACCESSIBLE > + > =C2=A0#ifndef __ASSEMBLY__ > =C2=A0 >=20 > =C2=A0/** > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 709d98fea90c..912f64f505f7 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -84,8 +84,8 @@ static void __init reserve_crashkernel(void) > =C2=A0 >=20 > =C2=A0 if (crash_base =3D=3D 0) { > =C2=A0 /* Current arm64 boot protocol requires 2MB alignment */ > - crash_base =3D memblock_find_in_range(0, arm64_dma_phys_limit, > - crash_size, SZ_2M); > + crash_base =3D memblock_find_in_range(CRASH_ALIGN, CRASH_ADDR_LOW_MAX, > + crash_size, CRASH_ALIGN); Actually we could get rid of CRASH_ADDR_LOW_MAX altogether if we used memblock_alloc_low() here (modulo the slight refactoring needed to accommod= ate it). Regards, Nicolas --=-LxuFd/trEQUkJJT19YKS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAmAcHrsACgkQlfZmHno8 x/4VFQf/Za2F0DPLs/4XStKKvgiOXxh7Z9VuNZK+TFpC0un67QwVwZs12jI0F4Bs Jdh8uz9B956OAwGio8TCE/HQs00jz7y68lfAAkDbLBLEA3BWqb6yrPOwmKa1pLy6 bn8xcIZX5m3gLj6AwEKQe1LKYaZrUV1PsW/rxDIH/ky7po51hf5f/q/72PnRVtkd 9jq9LYIfaCE+OvY6zxaxI7YrwjkXTMzMcliRmpO2PWZcWsW8DzsYJeqjOafs1+39 /UIjey5IdcNvrVQv373Ep2wVRIl7NMgPC6wc/2JiJ1MFedxStWZuj6tDizpy5y5Z sT7HzaCsxzMdMrmDwqzGELGWOpI0AQ== =ZCRh -----END PGP SIGNATURE----- --=-LxuFd/trEQUkJJT19YKS-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2ABDC433DB for ; Thu, 4 Feb 2021 16:21:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3087664DEC for ; Thu, 4 Feb 2021 16:21:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3087664DEC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:References:In-Reply-To:Date:To:From:Subject:Message-ID:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CaLwBa7KsBSopgA9HuPKux6xxdzJKCmzXB0AEMSH5GQ=; b=Obn5+vqgln6T5CjXJqI+mOfpj Xz3nMoIePdFzU01v4SL8PB8lJuDXQZ6TV63DQtxnonRxyltddSFY3hyp6Y0mRNHFMN8cwlR6q8c5c +I9GGr5N6zykXfQAh8pAIB9MSdO2nOcJrlYx2oJs6LJd6jdFqsXBiCRZBadz84ixzUEjyDISgsXZ7 jZ51e2xuFalJmrzLZzrb9toewnUDk43uudzMFn290TH8EuUzdUOoIEgwjLL92VvjUu9vn6LXMNYTp /I5ItYhc+Gp15lzzJelNYufw8582spgjgfntMHronrkddz3deVzX6d4LQz8LB16wHdL4ScwkuwPwB eFzt4hiIw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7hMi-0002Dt-DM; Thu, 04 Feb 2021 16:20:20 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7hMf-0002DP-Ey; Thu, 04 Feb 2021 16:20:18 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 52306ABD5; Thu, 4 Feb 2021 16:20:14 +0000 (UTC) Message-ID: Subject: Re: [PATCH v14 07/11] arm64: kdump: introduce some macroes for crash kernel reservation From: Nicolas Saenz Julienne To: Chen Zhou , mingo@redhat.com, tglx@linutronix.de, rppt@kernel.org, dyoung@redhat.com, bhe@redhat.com, catalin.marinas@arm.com, will@kernel.org, corbet@lwn.net, John.P.donnelly@oracle.com, bhsharma@redhat.com, prabhakar.pkin@gmail.com Date: Thu, 04 Feb 2021 17:20:11 +0100 In-Reply-To: <20210130071025.65258-8-chenzhou10@huawei.com> References: <20210130071025.65258-1-chenzhou10@huawei.com> <20210130071025.65258-8-chenzhou10@huawei.com> User-Agent: Evolution 3.38.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210204_112017_727141_045329DC X-CRM114-Status: GOOD ( 18.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wangkefeng.wang@huawei.com, arnd@arndb.de, xiexiuqi@huawei.com, linux-doc@vger.kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, horms@verge.net.au, james.morse@arm.com, huawei.libin@huawei.com, guohanjun@huawei.com, linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============8159315736067854776==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============8159315736067854776== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-LxuFd/trEQUkJJT19YKS" --=-LxuFd/trEQUkJJT19YKS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Chen, On Sat, 2021-01-30 at 15:10 +0800, Chen Zhou wrote: > Introduce macro CRASH_ALIGN for alignment, macro CRASH_ADDR_LOW_MAX > for upper bound of low crash memory, macro CRASH_ADDR_HIGH_MAX for > upper bound of high crash memory, use macroes instead. >=20 > Besides, keep consistent with x86, use CRASH_ALIGN as the lower bound > of crash kernel reservation. >=20 > Signed-off-by: Chen Zhou > Tested-by: John Donnelly > --- > =C2=A0arch/arm64/include/asm/kexec.h | 6 ++++++ > =C2=A0arch/arm64/mm/init.c | 6 +++--- > =C2=A02 files changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexe= c.h > index d24b527e8c00..3f6ecae0bc68 100644 > --- a/arch/arm64/include/asm/kexec.h > +++ b/arch/arm64/include/asm/kexec.h > @@ -25,6 +25,12 @@ > =C2=A0 >=20 > =C2=A0#define KEXEC_ARCH KEXEC_ARCH_AARCH64 > =C2=A0 >=20 > +/* 2M alignment for crash kernel regions */ > +#define CRASH_ALIGN SZ_2M > + > +#define CRASH_ADDR_LOW_MAX arm64_dma_phys_limit I wonder if you could use 'ARCH_LOW_ADDRESS_LIMIT', instead of creating a n= ew define. > +#define CRASH_ADDR_HIGH_MAX MEMBLOCK_ALLOC_ACCESSIBLE > + > =C2=A0#ifndef __ASSEMBLY__ > =C2=A0 >=20 > =C2=A0/** > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 709d98fea90c..912f64f505f7 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -84,8 +84,8 @@ static void __init reserve_crashkernel(void) > =C2=A0 >=20 > =C2=A0 if (crash_base =3D=3D 0) { > =C2=A0 /* Current arm64 boot protocol requires 2MB alignment */ > - crash_base =3D memblock_find_in_range(0, arm64_dma_phys_limit, > - crash_size, SZ_2M); > + crash_base =3D memblock_find_in_range(CRASH_ALIGN, CRASH_ADDR_LOW_MAX, > + crash_size, CRASH_ALIGN); Actually we could get rid of CRASH_ADDR_LOW_MAX altogether if we used memblock_alloc_low() here (modulo the slight refactoring needed to accommod= ate it). Regards, Nicolas --=-LxuFd/trEQUkJJT19YKS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAmAcHrsACgkQlfZmHno8 x/4VFQf/Za2F0DPLs/4XStKKvgiOXxh7Z9VuNZK+TFpC0un67QwVwZs12jI0F4Bs Jdh8uz9B956OAwGio8TCE/HQs00jz7y68lfAAkDbLBLEA3BWqb6yrPOwmKa1pLy6 bn8xcIZX5m3gLj6AwEKQe1LKYaZrUV1PsW/rxDIH/ky7po51hf5f/q/72PnRVtkd 9jq9LYIfaCE+OvY6zxaxI7YrwjkXTMzMcliRmpO2PWZcWsW8DzsYJeqjOafs1+39 /UIjey5IdcNvrVQv373Ep2wVRIl7NMgPC6wc/2JiJ1MFedxStWZuj6tDizpy5y5Z sT7HzaCsxzMdMrmDwqzGELGWOpI0AQ== =ZCRh -----END PGP SIGNATURE----- --=-LxuFd/trEQUkJJT19YKS-- --===============8159315736067854776== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============8159315736067854776==-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Message-ID: Subject: Re: [PATCH v14 07/11] arm64: kdump: introduce some macroes for crash kernel reservation From: Nicolas Saenz Julienne Date: Thu, 04 Feb 2021 17:20:11 +0100 In-Reply-To: <20210130071025.65258-8-chenzhou10@huawei.com> References: <20210130071025.65258-1-chenzhou10@huawei.com> <20210130071025.65258-8-chenzhou10@huawei.com> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============8039808537505538186==" Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Chen Zhou , mingo@redhat.com, tglx@linutronix.de, rppt@kernel.org, dyoung@redhat.com, bhe@redhat.com, catalin.marinas@arm.com, will@kernel.org, corbet@lwn.net, John.P.donnelly@oracle.com, bhsharma@redhat.com, prabhakar.pkin@gmail.com Cc: wangkefeng.wang@huawei.com, arnd@arndb.de, xiexiuqi@huawei.com, linux-doc@vger.kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, horms@verge.net.au, james.morse@arm.com, huawei.libin@huawei.com, guohanjun@huawei.com, linux-arm-kernel@lists.infradead.org --===============8039808537505538186== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-LxuFd/trEQUkJJT19YKS" --=-LxuFd/trEQUkJJT19YKS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Chen, On Sat, 2021-01-30 at 15:10 +0800, Chen Zhou wrote: > Introduce macro CRASH_ALIGN for alignment, macro CRASH_ADDR_LOW_MAX > for upper bound of low crash memory, macro CRASH_ADDR_HIGH_MAX for > upper bound of high crash memory, use macroes instead. >=20 > Besides, keep consistent with x86, use CRASH_ALIGN as the lower bound > of crash kernel reservation. >=20 > Signed-off-by: Chen Zhou > Tested-by: John Donnelly > --- > =C2=A0arch/arm64/include/asm/kexec.h | 6 ++++++ > =C2=A0arch/arm64/mm/init.c | 6 +++--- > =C2=A02 files changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexe= c.h > index d24b527e8c00..3f6ecae0bc68 100644 > --- a/arch/arm64/include/asm/kexec.h > +++ b/arch/arm64/include/asm/kexec.h > @@ -25,6 +25,12 @@ > =C2=A0 >=20 > =C2=A0#define KEXEC_ARCH KEXEC_ARCH_AARCH64 > =C2=A0 >=20 > +/* 2M alignment for crash kernel regions */ > +#define CRASH_ALIGN SZ_2M > + > +#define CRASH_ADDR_LOW_MAX arm64_dma_phys_limit I wonder if you could use 'ARCH_LOW_ADDRESS_LIMIT', instead of creating a n= ew define. > +#define CRASH_ADDR_HIGH_MAX MEMBLOCK_ALLOC_ACCESSIBLE > + > =C2=A0#ifndef __ASSEMBLY__ > =C2=A0 >=20 > =C2=A0/** > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 709d98fea90c..912f64f505f7 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -84,8 +84,8 @@ static void __init reserve_crashkernel(void) > =C2=A0 >=20 > =C2=A0 if (crash_base =3D=3D 0) { > =C2=A0 /* Current arm64 boot protocol requires 2MB alignment */ > - crash_base =3D memblock_find_in_range(0, arm64_dma_phys_limit, > - crash_size, SZ_2M); > + crash_base =3D memblock_find_in_range(CRASH_ALIGN, CRASH_ADDR_LOW_MAX, > + crash_size, CRASH_ALIGN); Actually we could get rid of CRASH_ADDR_LOW_MAX altogether if we used memblock_alloc_low() here (modulo the slight refactoring needed to accommod= ate it). Regards, Nicolas --=-LxuFd/trEQUkJJT19YKS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEErOkkGDHCg2EbPcGjlfZmHno8x/4FAmAcHrsACgkQlfZmHno8 x/4VFQf/Za2F0DPLs/4XStKKvgiOXxh7Z9VuNZK+TFpC0un67QwVwZs12jI0F4Bs Jdh8uz9B956OAwGio8TCE/HQs00jz7y68lfAAkDbLBLEA3BWqb6yrPOwmKa1pLy6 bn8xcIZX5m3gLj6AwEKQe1LKYaZrUV1PsW/rxDIH/ky7po51hf5f/q/72PnRVtkd 9jq9LYIfaCE+OvY6zxaxI7YrwjkXTMzMcliRmpO2PWZcWsW8DzsYJeqjOafs1+39 /UIjey5IdcNvrVQv373Ep2wVRIl7NMgPC6wc/2JiJ1MFedxStWZuj6tDizpy5y5Z sT7HzaCsxzMdMrmDwqzGELGWOpI0AQ== =ZCRh -----END PGP SIGNATURE----- --=-LxuFd/trEQUkJJT19YKS-- --===============8039808537505538186== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec --===============8039808537505538186==--