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 D8C1FC433EF for ; Fri, 6 May 2022 23:11:51 +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:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z6Ted6UXGlWtFw6SRyW+gvLsaxVHW74RwYH1ompB7dU=; b=YSu0ImqAdVYvCm Dm6hBUMIRWmu6eK3iWLGFQzaOcu8XzS2nevJpgZ6HnRJe92j2gBegYk6FFZzXZUT4OWbv2ogeNZnR PEU63ditvDMC89wdddbW7+ImLbyK2c76xmGUOX0G/ooYlrc+7Dz4sR2E0r2gt+WtCALHX/5gOxBVX g9NN9H5Py8xsFTQCi0GmAuG87JAbhx0G+PKE5q80fwwZJL6KoOYAHOfJ+BnITJdNW0JgcMEVCrPsa /pNuA5jYpl/NnqQlad5Z4DTWWjcX79oq8kkM7YRCTcDQiHYVtkKWKd2fAydyvkUJcQikS0hkH4ufU J1jxAcNY/PoEX0JCvLYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nn75z-005Kkn-5a; Fri, 06 May 2022 23:10:47 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nn75w-005Kjh-4L for linux-arm-kernel@lists.infradead.org; Fri, 06 May 2022 23:10:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651878643; 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=QDEUBZQi2gkd5vGN65bG0cDs8TDhy97WSz0PhVlgRoE=; b=VX9MS7P40lY8/O1ALbiDrkLMBtjrswMgQMvp/y+OcxrXkiED6UivoB8PqveLtnoOFu8mj+ Bk9y9lSbLrmVgkT+jraGRFvjxN/CK8JchZlKN9wdDneqYuNr8AS+24HDfIbA26VpPm+0vL Bjl6VgxrWsZebgT/bluUI85yLfGY/aQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-TAhXEYwDNG2uu1lmYE4cTA-1; Fri, 06 May 2022 19:10:38 -0400 X-MC-Unique: TAhXEYwDNG2uu1lmYE4cTA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0110F3C01C00; Fri, 6 May 2022 23:10:37 +0000 (UTC) Received: from localhost (ovpn-12-33.pek2.redhat.com [10.72.12.33]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3ABC40CF8E8; Fri, 6 May 2022 23:10:35 +0000 (UTC) Date: Sat, 7 May 2022 07:10:32 +0800 From: Baoquan He To: Zhen Lei , Catalin Marinas Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , linux-kernel@vger.kernel.org, Dave Young , Vivek Goyal , Eric Biederman , kexec@lists.infradead.org, Will Deacon , linux-arm-kernel@lists.infradead.org, Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Randy Dunlap , Feng Zhou , Kefeng Wang , Chen Zhou , John Donnelly , Dave Kleikamp Subject: Re: [PATCH v24 3/6] arm64: kdump: Reimplement crashkernel=X Message-ID: <20220506231032.GA122876@MiWiFi-R3L-srv> References: <20220506114402.365-1-thunder.leizhen@huawei.com> <20220506114402.365-4-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220506114402.365-4-thunder.leizhen@huawei.com> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220506_161044_281856_682F98C7 X-CRM114-Status: GOOD ( 18.67 ) 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 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 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel