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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73A47C433F5 for ; Sat, 7 May 2022 01:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:CC:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=RTmhlN9/sFvTeDZXYryQR0/X/PSZd/fhshNLv4Laxxg=; b=eWI+oC5YfD5gHK8QvoS1pVA0Eu Fbhe3OX17ZEOkcFlb5giZLBRX/zu1gg5fAs3YEZYErBvqrpjEx5UGnE/aNwskJXZPWUMJi1jfKmFw 8An/lvvm9q10WfILp83BANFgoSc0PDvsLlggaERuSh5q39YnU3KhHVDyrWuEnwBB4mLq5URJUCyJH Sy0rHPtSVs0GxtekRRoeDxUi+gePWen7SCsHvdh4I78Zf6HeJQ38YvhHY1Zx0UgxWqapuWzD1EZc5 4ZJtRXnyVBf3IR6CkS4q0/snx40Zr8MLJaaqeIHlukzwpqkRxiwW5uP7ZM2VTxYeEdwfFlZ/DXEEd VcYFFj1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nn9Ko-005c6E-Fw; Sat, 07 May 2022 01:34:14 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nn9Ki-005c4I-SG; Sat, 07 May 2022 01:34:11 +0000 Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Kw9164hhcz1JBsV; Sat, 7 May 2022 09:32:58 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 7 May 2022 09:34:05 +0800 Received: from [10.174.178.55] (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 7 May 2022 09:34:03 +0800 Subject: Re: [PATCH v24 3/6] arm64: kdump: Reimplement crashkernel=X To: Baoquan He , Catalin Marinas CC: Thomas Gleixner , Ingo Molnar , Borislav Petkov , , "H . Peter Anvin" , , Dave Young , Vivek Goyal , Eric Biederman , , Will Deacon , , Rob Herring , Frank Rowand , , Jonathan Corbet , , Randy Dunlap , Feng Zhou , Kefeng Wang , "Chen Zhou" , John Donnelly , Dave Kleikamp References: <20220506114402.365-1-thunder.leizhen@huawei.com> <20220506114402.365-4-thunder.leizhen@huawei.com> <20220506231032.GA122876@MiWiFi-R3L-srv> From: "Leizhen (ThunderTown)" Message-ID: Date: Sat, 7 May 2022 09:34:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20220506231032.GA122876@MiWiFi-R3L-srv> Content-Language: en-US X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220506_183409_281926_9AF1A38E X-CRM114-Status: GOOD ( 17.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2022/5/7 7:10, Baoquan He wrote: > On 05/06/22 at 07:43pm, Zhen Lei wrote: > ...... >> @@ -118,8 +162,7 @@ static void __init reserve_crashkernel(void) >> if (crash_base) >> crash_max = crash_base + crash_size; >> >> - /* Current arm64 boot protocol requires 2MB alignment */ >> - crash_base = memblock_phys_alloc_range(crash_size, SZ_2M, >> + crash_base = memblock_phys_alloc_range(crash_size, CRASH_ALIGN, >> crash_base, crash_max); >> if (!crash_base) { >> pr_warn("cannot allocate crashkernel (size:0x%llx)\n", >> @@ -127,6 +170,11 @@ static void __init reserve_crashkernel(void) >> return; >> } >> > > There's corner case missed, e.g > 1) ,high and ,low are specified, CONFIG_ZONE_DMA|DMA32 is not enabled; > 2) ,high and ,low are specified, the whole system memory is under 4G. > > Below judgement can filter them away: > > if (crash_base > arm64_dma_phys_limit && crash_low_size && > reserve_crashkernel_low(crash_low_size)) { > > What's your opinion? Leave it and add document to notice user, or fix it > with code change? I think maybe we can leave it unchanged. If the user configures two memory ranges, we'd better apply for two. Otherwise, he'll be confused when he inquires. Currently, crash_low_size is non-zero only when 'crashkernel=Y,low' is explicitly configured. > > I would suggest merging this series, Lei can add this corner case > handling on top. Since this is a newly added support, we don't have > to make it one step. Doing step by step can make reviewing easier. > >> + if (crash_low_size && reserve_crashkernel_low(crash_low_size)) { >> + memblock_phys_free(crash_base, crash_size); >> + return; >> + } >> + >> pr_info("crashkernel reserved: 0x%016llx - 0x%016llx (%lld MB)\n", >> crash_base, crash_base + crash_size, crash_size >> 20); >> >> @@ -135,6 +183,9 @@ static void __init reserve_crashkernel(void) >> * map. Inform kmemleak so that it won't try to access it. >> */ >> kmemleak_ignore_phys(crash_base); >> + if (crashk_low_res.end) >> + kmemleak_ignore_phys(crashk_low_res.start); >> + >> crashk_res.start = crash_base; >> crashk_res.end = crash_base + crash_size - 1; >> insert_resource(&iomem_resource, &crashk_res); >> -- >> 2.25.1 >> > > . > -- Regards, Zhen Lei _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel