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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 CE0CBC433DB for ; Sat, 26 Dec 2020 10:36:35 +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 5F3442080C for ; Sat, 26 Dec 2020 10:36:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F3442080C 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=38cn/Bv/Jaow5xsIdhgdj+SoQC46QMlJPUrcumfLchw=; b=itj5AyRJ2kLh98bT7R3FQkTFL uf5r5/W/RlYIzFzlr64arVFJoi8u6MIEILccxVy38958Khmn+9s+8FC303/tYhWspd0j76I4YMr40 eNKwm0Md+1Lux0HAOH25jEOKYNKb2L5EX2/z293VV+QF1aXfaZVganWsaBDOtpOYBOxWp4VIFRrWy 0hdeFzNhIZCCq35BXvYQED8HWdnDBr1GIax+FpPEwMX5xBqhRW292sy+WrLQ4Mg3mYSfVVIkhVguR kkyB4ko/YgtIqzg+B/AGNa1yDFG4nsFxlKiKInkhIwyoFAJ17A3x1OMKM4PGhVOAE8wnKlClAhb5E tvFeGPB0Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kt6uf-00081h-Hb; Sat, 26 Dec 2020 10:35:05 +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 1kt6ud-00080u-7h for linux-arm-kernel@lists.infradead.org; Sat, 26 Dec 2020 10:35:04 +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 5EC79AD0F; Sat, 26 Dec 2020 10:35:00 +0000 (UTC) Message-ID: <653d43ed326e6a3974660c0ca2ad8a847a4ff986.camel@suse.de> Subject: Re: [PATCH 2/2] arm64: mm: fix kdump broken with ZONE_DMA reintroduced From: Nicolas Saenz Julienne To: Chen Zhou , catalin.marinas@arm.com, will@kernel.org Date: Sat, 26 Dec 2020 11:34:58 +0100 In-Reply-To: <20201226033557.116251-3-chenzhou10@huawei.com> References: <20201226033557.116251-1-chenzhou10@huawei.com> <20201226033557.116251-3-chenzhou10@huawei.com> User-Agent: Evolution 3.38.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201226_053503_427125_EE610E8C X-CRM114-Status: GOOD ( 19.26 ) 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: song.bao.hua@hisilicon.com, xiexiuqi@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, huawei.libin@huawei.com, akpm@linux-foundation.org, ardb@kernel.org, rppt@kernel.org Content-Type: multipart/mixed; boundary="===============1073195316803111455==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1073195316803111455== Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-ttraNiikuS3d3EHqG2nf" --=-ttraNiikuS3d3EHqG2nf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Chen, thanks for looking at this. On Sat, 2020-12-26 at 11:35 +0800, Chen Zhou wrote: > If the memory reserved for crash dump kernel falled in ZONE_DMA32, > the devices in crash dump kernel need to use ZONE_DMA will alloc fail. >=20 > Fix this by reserving low memory in ZONE_DMA if CONFIG_ZONE_DMA is > enabled, otherwise, reserving in ZONE_DMA32. >=20 > Fixes: bff3b04460a8 ("arm64: mm: reserve CMA and crashkernel in ZONE_DMA3= 2") I'm not so sure this counts as a fix, if someone backports it it'll probabl= y break things as it depends on the series that dynamically sizes DMA zones. > Signed-off-by: Chen Zhou > --- Why not doing the same with CMA? You'll probably have to move the dma_contiguous_reserve() call into bootmem_init() so as to make sure that arm64_dma_phys_limit is populated. Regards, Nicolas > =C2=A0arch/arm64/mm/init.c | 3 ++- > =C2=A01 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 7b9809e39927..5074e945f1a6 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -85,7 +85,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_dma32_phys_limit, > + crash_base =3D memblock_find_in_range(0, > + arm64_dma_phys_limit ? : arm64_dma32_phys_limit, > =C2=A0 crash_size, SZ_2M); > =C2=A0 if (crash_base =3D=3D 0) { > =C2=A0 pr_warn("cannot allocate crashkernel (size:0x%llx)\n", --=-ttraNiikuS3d3EHqG2nf 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/4FAl/nEdIACgkQlfZmHno8 x/58fAgAo/JlSNiKD9iXK2qb3QBSd4FhVpD5uFEaRPFGZJ2gROTApl9USk8jOMSS cr6z6lVl9fw+MD6xN2ceEPAFIMzlrurME4WUgZMcFoN0gLRAcW9iAlQUCQh+offk 22zl7NwD8fUYmtpWZIa3J72Ycol9q7aUotz62jcurryjO7tw1a6x3yUV2oyVJ2fq gH+k7ozVZowGWWyW3vWU66kq7pFUuKxA/2ruehWI1cfFYardeVGpDYQTCZgerxSH O73DfB9WdPMSz/iJFau8Nvj5/Jn/bmNlN7hLhcKgzf7kH+PKkLKtTAGQRMpHW33m oVYuRWBQN8vbtkK4q8d/+n1HI3CZwg== =0ERD -----END PGP SIGNATURE----- --=-ttraNiikuS3d3EHqG2nf-- --===============1073195316803111455== 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 --===============1073195316803111455==-- 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=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 E90CFC433E0 for ; Sat, 26 Dec 2020 10:35:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8CCC221E9 for ; Sat, 26 Dec 2020 10:35:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726017AbgLZKfm (ORCPT ); Sat, 26 Dec 2020 05:35:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:38202 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbgLZKfl (ORCPT ); Sat, 26 Dec 2020 05:35:41 -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 5EC79AD0F; Sat, 26 Dec 2020 10:35:00 +0000 (UTC) Message-ID: <653d43ed326e6a3974660c0ca2ad8a847a4ff986.camel@suse.de> Subject: Re: [PATCH 2/2] arm64: mm: fix kdump broken with ZONE_DMA reintroduced From: Nicolas Saenz Julienne To: Chen Zhou , catalin.marinas@arm.com, will@kernel.org Cc: ardb@kernel.org, akpm@linux-foundation.org, rppt@kernel.org, song.bao.hua@hisilicon.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, huawei.libin@huawei.com, xiexiuqi@huawei.com Date: Sat, 26 Dec 2020 11:34:58 +0100 In-Reply-To: <20201226033557.116251-3-chenzhou10@huawei.com> References: <20201226033557.116251-1-chenzhou10@huawei.com> <20201226033557.116251-3-chenzhou10@huawei.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-ttraNiikuS3d3EHqG2nf" User-Agent: Evolution 3.38.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-ttraNiikuS3d3EHqG2nf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Chen, thanks for looking at this. On Sat, 2020-12-26 at 11:35 +0800, Chen Zhou wrote: > If the memory reserved for crash dump kernel falled in ZONE_DMA32, > the devices in crash dump kernel need to use ZONE_DMA will alloc fail. >=20 > Fix this by reserving low memory in ZONE_DMA if CONFIG_ZONE_DMA is > enabled, otherwise, reserving in ZONE_DMA32. >=20 > Fixes: bff3b04460a8 ("arm64: mm: reserve CMA and crashkernel in ZONE_DMA3= 2") I'm not so sure this counts as a fix, if someone backports it it'll probabl= y break things as it depends on the series that dynamically sizes DMA zones. > Signed-off-by: Chen Zhou > --- Why not doing the same with CMA? You'll probably have to move the dma_contiguous_reserve() call into bootmem_init() so as to make sure that arm64_dma_phys_limit is populated. Regards, Nicolas > =C2=A0arch/arm64/mm/init.c | 3 ++- > =C2=A01 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 7b9809e39927..5074e945f1a6 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -85,7 +85,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_dma32_phys_limit, > + crash_base =3D memblock_find_in_range(0, > + arm64_dma_phys_limit ? : arm64_dma32_phys_limit, > =C2=A0 crash_size, SZ_2M); > =C2=A0 if (crash_base =3D=3D 0) { > =C2=A0 pr_warn("cannot allocate crashkernel (size:0x%llx)\n", --=-ttraNiikuS3d3EHqG2nf 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/4FAl/nEdIACgkQlfZmHno8 x/58fAgAo/JlSNiKD9iXK2qb3QBSd4FhVpD5uFEaRPFGZJ2gROTApl9USk8jOMSS cr6z6lVl9fw+MD6xN2ceEPAFIMzlrurME4WUgZMcFoN0gLRAcW9iAlQUCQh+offk 22zl7NwD8fUYmtpWZIa3J72Ycol9q7aUotz62jcurryjO7tw1a6x3yUV2oyVJ2fq gH+k7ozVZowGWWyW3vWU66kq7pFUuKxA/2ruehWI1cfFYardeVGpDYQTCZgerxSH O73DfB9WdPMSz/iJFau8Nvj5/Jn/bmNlN7hLhcKgzf7kH+PKkLKtTAGQRMpHW33m oVYuRWBQN8vbtkK4q8d/+n1HI3CZwg== =0ERD -----END PGP SIGNATURE----- --=-ttraNiikuS3d3EHqG2nf--