Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp8865142pxu; Sun, 27 Dec 2020 23:36:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5Rl+dlPysda5pB2g4KoBhbnFKpS+dybML+iWrnEIEJGbl2l/WWoC2xF2WYBpO0qCKvc3Q X-Received: by 2002:a17:907:20b5:: with SMTP id pw21mr42227717ejb.494.1609141015864; Sun, 27 Dec 2020 23:36:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609141015; cv=none; d=google.com; s=arc-20160816; b=dy6qu44AsRQsVB+I++2V5b005xnHVTX9u9YILljm6/HGfvssm0RbeRwW/HE17OGKPO KcHsKjNX5ASp5weBiGbOYk8lPjaCVbseXzMmJvBYNHlQ3Bk6BPsFuqxapSN5Q9qyhvGP YbgEEOrpQRPk4PRcZjGWn+EZXj1iVGZOvGXESl4FMMqAkWYKexmIZuHD5MHGzGU2iZ7O Eynz2VSp01A9HEtNlsh7rWQDYq6V+iDw4hZNCHNDxdBvWp0gT/F/P8iaExvyOn6GDztp +SCkRbHSogXndO19gLLA4VNZAjFFbnarKvyV2FdRftWqFN5zyI5l+cMu8Y88qB8G/t3H 4erQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=xFBtTsXpbxiWaVv8BRezwOkiKWcoVpVODQj84pAwijU=; b=j9wSMBCLm0a02VH7ewAqvG7h125Jb1eB62mlKdvhX30S/451PYufaAYlbfHdPPbAG0 9Wrj4JMgDKW3t+NT6pg12bX6RqMooKSfr4l65hUkMX2qYYFqYUA/3qLuUV6WbLPdezD6 qMhEaoFedGGD7Rbq0mpphE3Gam5lUJ7ZRNAvL9EQL1SSiLtndPDrkcWnZe1ZiFWKPdP4 EsMR6/xGS+EWM+SXlzTz8AvBELu0eRqS22Vxquzr0RtpgkVFppwddAeEIa496LRFXIYv aSW57SebTtSfdiNPY3v77ieaagb94XXWkPOMdR3WYMKVKp4swcioCcQNMyOFHXbzM4Fx 71fg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v2si21239712edw.41.2020.12.27.23.36.33; Sun, 27 Dec 2020 23:36: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726412AbgL1Hdk (ORCPT + 99 others); Mon, 28 Dec 2020 02:33:40 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:9651 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726253AbgL1Hdj (ORCPT ); Mon, 28 Dec 2020 02:33:39 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4D48Q04dk6z15kqm; Mon, 28 Dec 2020 15:32:08 +0800 (CST) Received: from [10.174.176.61] (10.174.176.61) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Mon, 28 Dec 2020 15:32:50 +0800 Subject: Re: [PATCH 2/2] arm64: mm: fix kdump broken with ZONE_DMA reintroduced To: Nicolas Saenz Julienne , , References: <20201226033557.116251-1-chenzhou10@huawei.com> <20201226033557.116251-3-chenzhou10@huawei.com> <653d43ed326e6a3974660c0ca2ad8a847a4ff986.camel@suse.de> CC: , , , , , , , From: chenzhou Message-ID: Date: Mon, 28 Dec 2020 15:32:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <653d43ed326e6a3974660c0ca2ad8a847a4ff986.camel@suse.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.176.61] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nicolas, Thanks for your review. On 2020/12/26 18:34, Nicolas Saenz Julienne wrote: > 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. >> >> Fix this by reserving low memory in ZONE_DMA if CONFIG_ZONE_DMA is >> enabled, otherwise, reserving in ZONE_DMA32. >> >> Fixes: bff3b04460a8 ("arm64: mm: reserve CMA and crashkernel in ZONE_DMA32") > I'm not so sure this counts as a fix, if someone backports it it'll probably > break things as it depends on the series that dynamically sizes DMA zones. I write this just because kdump is broken from this commit. > >> 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. You are right, CMA also need this. I will do this in next version. Thanks, Chen Zhou > > Regards, > Nicolas > >> arch/arm64/mm/init.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> 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) >> >> >> if (crash_base == 0) { >> /* Current arm64 boot protocol requires 2MB alignment */ >> - crash_base = memblock_find_in_range(0, arm64_dma32_phys_limit, >> + crash_base = memblock_find_in_range(0, >> + arm64_dma_phys_limit ? : arm64_dma32_phys_limit, >> crash_size, SZ_2M); >> if (crash_base == 0) { >> pr_warn("cannot allocate crashkernel (size:0x%llx)\n", >