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 CC04DC433F5 for ; Wed, 27 Apr 2022 07:13:43 +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=6Y/WkVvLxnHWR5P2lWif06newykD1dxyP++S0/QdeeI=; b=OPJxqxX60hCNFhPv5WH8bDnePZ dq2tt6mgou6oV7c2SV+lYJkSlKhmiIK2gC+4z0+ZDFebGsjgQ3UfaHUUo62qggckzMLFbVcldg3ez 7x9VzJ/DRY3souqxsOhQ+Wift96zX12ru353lRvIYbw9lEpOQOvt0nlmwU727Hfv4zmLnhmr+jCb5 BdiqD9lDS1THZUXcb4fCZjFf0qj+a8Vfvv59X4sHl6nV3bczfcg8AxZTYOaiynTSxerBbi+qz3QdG gevuMXuzBg8wua6N6FUH0DmqjOX8GoX2DvlVSHTfefF8YVp3sP/hoEDWAHuLUesuswJ9xNASrS51V ahU6aX8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njbqu-000CX7-0f; Wed, 27 Apr 2022 07:12:44 +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 1njbql-000CP8-Qg; Wed, 27 Apr 2022 07:12:37 +0000 Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Kp90T16Bpz1JBm0; Wed, 27 Apr 2022 15:11:37 +0800 (CST) Received: from dggpemm500006.china.huawei.com (7.185.36.236) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 27 Apr 2022 15:12:30 +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; Wed, 27 Apr 2022 15:12:29 +0800 Subject: Re: [PATCH v22 4/9] arm64: kdump: Don't force page-level mappings for memory above 4G To: Catalin Marinas CC: Thomas Gleixner , Ingo Molnar , Borislav Petkov , , "H . Peter Anvin" , , Dave Young , Baoquan He , 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: <20220414115720.1887-1-thunder.leizhen@huawei.com> <20220414115720.1887-5-thunder.leizhen@huawei.com> From: "Leizhen (ThunderTown)" Message-ID: Date: Wed, 27 Apr 2022 15:12:29 +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: 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-20220427_001236_061213_7BBD1DBE X-CRM114-Status: GOOD ( 14.78 ) 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/4/26 22:26, Catalin Marinas wrote: > On Thu, Apr 14, 2022 at 07:57:15PM +0800, Zhen Lei wrote: >> @@ -540,13 +540,31 @@ static void __init map_mem(pgd_t *pgdp) >> for_each_mem_range(i, &start, &end) { >> if (start >= end) >> break; >> + >> +#ifdef CONFIG_KEXEC_CORE >> + if (eflags && (end >= SZ_4G)) { >> + /* >> + * The memory block cross the 4G boundary. >> + * Forcibly use page-level mappings for memory under 4G. >> + */ >> + if (start < SZ_4G) { >> + __map_memblock(pgdp, start, SZ_4G - 1, >> + pgprot_tagged(PAGE_KERNEL), flags | eflags); >> + start = SZ_4G; >> + } >> + >> + /* Page-level mappings is not mandatory for memory above 4G */ >> + eflags = 0; >> + } >> +#endif > > That's a bit tricky if a SoC has all RAM above 4G. IIRC AMD Seattle had > this layout. See max_zone_phys() for how we deal with this, basically > extending ZONE_DMA to the whole range if RAM starts above 4GB. In that > case, crashkernel reservation would fall in the range above 4GB. > > BTW, we changed the max_zone_phys() logic with commit 791ab8b2e3db > ("arm64: Ignore any DMA offsets in the max_zone_phys() calculation"). Okay, thanks for your correction. I'll dig into it after I've done the original requirement. > -- Regards, Zhen Lei _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel