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 E5D7FC433EF for ; Fri, 11 Feb 2022 10:51:34 +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=vKxav0pRgzIWBbr3JFSQdRkTtJwEyje0H0z9jteiVPk=; b=Fbejv88uQcFqZB iCFNBB2cbcC104VFf/gSGAh4i2Wd9mz/yhFWiuZeN2+WFcuM/fGvj6mNYjLfwErruNrShYk2FJfnC lspRZBis4eGVbe/SZIFLaVRJCLWwIWbYfOPGfAaVubNT6fRO2rbSQDNxXPEhfogwYTHPgslnj4scF OJy2BwXFiz7P02dOzr25kjK0jicidhjBfG1e0Yt+RK03Ov4m7NFFVwd2G+fkYPZ3B5gZV57bytEpX MVMUQet1/1CsuEU7TWRp5fbrHJoHWSdZVGQRtZsE3azGwGGqap6vYcwfs6YkTr4KvhrJpBOt3p5Vx BNbI7mNWNFDcy01QYtkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nITUx-006glc-34; Fri, 11 Feb 2022 10:49:57 +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 1nITNm-006dgj-U6 for linux-arm-kernel@lists.infradead.org; Fri, 11 Feb 2022 10:42:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644576149; 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=8ek0uj/LUTnOMOsFu8yGHGsh602NG0Sgtj4vJHccYII=; b=CcJ1itX0r5dlU2qWnI1W3tsacVH5cfnFZOjtQdIvtU41ILixK/YQzoblq0s3h7TD9/yvDx Ejafs78jcRS5tE5BmAJXLlTHgTyUkpKdXyEhGrcdq0IAAcoQSAPhuIahcOEdLgoFXNlU7q Kotk+1fnL1Uqwd5br06v7qH2KFA7jhk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-302-Ov67G1aIMZW6XEOG22BK_Q-1; Fri, 11 Feb 2022 05:42:23 -0500 X-MC-Unique: Ov67G1aIMZW6XEOG22BK_Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2D1CF8D0689; Fri, 11 Feb 2022 10:39:53 +0000 (UTC) Received: from localhost (ovpn-13-96.pek2.redhat.com [10.72.13.96]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0B345452F; Fri, 11 Feb 2022 10:39:51 +0000 (UTC) Date: Fri, 11 Feb 2022 18:39:49 +0800 From: Baoquan He To: Zhen Lei 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, Catalin Marinas , 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 v20 2/5] arm64: kdump: introduce some macros for crash kernel reservation Message-ID: References: <20220124084708.683-1-thunder.leizhen@huawei.com> <20220124084708.683-3-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220124084708.683-3-thunder.leizhen@huawei.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220211_024231_086971_EDD2BDF3 X-CRM114-Status: GOOD ( 22.81 ) 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 01/24/22 at 04:47pm, Zhen Lei wrote: > From: Chen Zhou > > 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 macros instead. > > Signed-off-by: Chen Zhou > Signed-off-by: Zhen Lei > Tested-by: John Donnelly > Tested-by: Dave Kleikamp > --- > arch/arm64/mm/init.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 90f276d46b93bc6..6c653a2c7cff052 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -65,6 +65,12 @@ EXPORT_SYMBOL(memstart_addr); > phys_addr_t arm64_dma_phys_limit __ro_after_init; > > #ifdef CONFIG_KEXEC_CORE > +/* Current arm64 boot protocol requires 2MB alignment */ > +#define CRASH_ALIGN SZ_2M > + > +#define CRASH_ADDR_LOW_MAX arm64_dma_phys_limit > +#define CRASH_ADDR_HIGH_MAX MEMBLOCK_ALLOC_ACCESSIBLE MEMBLOCK_ALLOC_ACCESSIBLE is obvoiously a alloc flag for memblock allocator, I don't think it's appropriate to make HIGH_MAX get its value. You can make it as memblock.current_limit, or do not define it, but using MEMBLOCK_ALLOC_ACCESSIBLE direclty in memblock_phys_alloc_range() with a code comment. > + > /* > * reserve_crashkernel() - reserves memory for crash kernel > * > @@ -75,7 +81,7 @@ phys_addr_t arm64_dma_phys_limit __ro_after_init; > static void __init reserve_crashkernel(void) > { > unsigned long long crash_base, crash_size; > - unsigned long long crash_max = arm64_dma_phys_limit; > + unsigned long long crash_max = CRASH_ADDR_LOW_MAX; > int ret; > > ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(), > @@ -90,8 +96,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", > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel