Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1455082pxb; Thu, 14 Apr 2022 06:39:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAIQwuJhuOC2Xwga5lwlTZCbhb9CDC+3x9neUKaTYM30lcK38pO4m8wKzYFKXkuRn+jheI X-Received: by 2002:a05:6a00:8c6:b0:4fe:10df:1cfe with SMTP id s6-20020a056a0008c600b004fe10df1cfemr4002365pfu.18.1649943587167; Thu, 14 Apr 2022 06:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649943587; cv=none; d=google.com; s=arc-20160816; b=CvBs7ZGzHvZiMryzz9rSUkH/p/2g+JzaaxsgYlodUnOC5II8bOI5i56mXqopF45Bt0 gkPHcFGuAz9t0ZnYy4DIBJzoFJoPVCiBRHUM3pvgesUV2751oEA8Xa96a6YTu3GvAZAM 11lvq7Uc4yuLNPTsx9ZjihHF5cAg6s6SGMQ8T/AUbtQtzAvee0+cHAXEKbTnMVSt43/u q3ad/xGfUfiK77vxoehGbyQas6LC/Hf/Vs3NLiiuMWsufL989pZXrFAKed6hEMz0k6X9 l4fOlF+VVSBiyvxBMp8/XgSOyaHkZF/WjsJpqSMO69IUa8FU6F7AFVmbQ1ddrs/QjXnw fLoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=3cduW2zcdl5kTdOykz5qP0+xYWZFS6aJOX3cBOdWF0Y=; b=gzuNHVG8DAAGfogoznRLMhPhXgABPYSKfSkujJnQS89xrbFCVHV/6svyzUdFIz+U+0 /l8NqhKJWMRKh/kqe5kjS5YaVlLFNonce06mSun7Mx/RJDm0QNZwUzZogzZEvsXP4uQL ZveF8CvajqzVcoLWFru3bEvvPq7lk2ylNJeGWoozp5rszOpnW7a6lmSwtnDnczflXrKJ m4YQxNRU156grEyJ4ch5HTB3AIS2Ifpzg+iphGz9GZwsJdidI5+quLia/ip5rQJ/pHLo Caddur1RK25f9hItosMw+o56l07lfXcfjVaEIFD84pYTZETKXmru63O6Ug/JxdVGkfog CvTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a656747000000b0039d3482d602si9500831pgu.54.2022.04.14.06.39.32; Thu, 14 Apr 2022 06:39:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242058AbiDNJ5G (ORCPT + 99 others); Thu, 14 Apr 2022 05:57:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230483AbiDNJ45 (ORCPT ); Thu, 14 Apr 2022 05:56:57 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 580B32DE6; Thu, 14 Apr 2022 02:54:31 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KfF9b4wyyzFppJ; Thu, 14 Apr 2022 17:52:03 +0800 (CST) Received: from dggpemm500014.china.huawei.com (7.185.36.153) 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; Thu, 14 Apr 2022 17:54:29 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500014.china.huawei.com (7.185.36.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 14 Apr 2022 17:54:28 +0800 From: Wupeng Ma To: , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v2 1/9] efi: Make efi_print_memmap() public Date: Thu, 14 Apr 2022 18:13:06 +0800 Message-ID: <20220414101314.1250667-2-mawupeng1@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 In-Reply-To: <20220414101314.1250667-1-mawupeng1@huawei.com> References: <20220414101314.1250667-1-mawupeng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ma Wupeng Make efi_print_memmap() public in preparation for adding fake memory support for architecture with efi support, eg, arm64. Signed-off-by: Ma Wupeng --- arch/x86/include/asm/efi.h | 1 - arch/x86/platform/efi/efi.c | 16 ---------------- drivers/firmware/efi/memmap.c | 16 ++++++++++++++++ include/linux/efi.h | 1 + 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 98938a68251c..686968073f48 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -150,7 +150,6 @@ extern asmlinkage u64 __efi_call(void *fp, ...); #endif /* CONFIG_X86_32 */ extern int __init efi_memblock_x86_reserve_range(void); -extern void __init efi_print_memmap(void); extern void __init efi_map_region(efi_memory_desc_t *md); extern void __init efi_map_region_fixed(efi_memory_desc_t *md); extern void efi_sync_low_kernel_mappings(void); diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 147c30a81f15..7b130f39d841 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -323,22 +323,6 @@ static void __init efi_clean_memmap(void) } } -void __init efi_print_memmap(void) -{ - efi_memory_desc_t *md; - int i = 0; - - for_each_efi_memory_desc(md) { - char buf[64]; - - pr_info("mem%02u: %s range=[0x%016llx-0x%016llx] (%lluMB)\n", - i++, efi_md_typeattr_format(buf, sizeof(buf), md), - md->phys_addr, - md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1, - (md->num_pages >> (20 - EFI_PAGE_SHIFT))); - } -} - static int __init efi_systab_init(unsigned long phys) { int size = efi_enabled(EFI_64BIT) ? sizeof(efi_system_table_64_t) diff --git a/drivers/firmware/efi/memmap.c b/drivers/firmware/efi/memmap.c index 4df55a55da84..04cc1f2cdfa4 100644 --- a/drivers/firmware/efi/memmap.c +++ b/drivers/firmware/efi/memmap.c @@ -376,3 +376,19 @@ void __init efi_memmap_insert(struct efi_memory_map *old_memmap, void *buf, } } } + +void __init efi_print_memmap(void) +{ + efi_memory_desc_t *md; + int i = 0; + + for_each_efi_memory_desc(md) { + char buf[64]; + + pr_info("mem%02u: %s range=[0x%016llx-0x%016llx] (%lluMB)\n", + i++, efi_md_typeattr_format(buf, sizeof(buf), md), + md->phys_addr, + md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - 1, + (md->num_pages >> (20 - EFI_PAGE_SHIFT))); + } +} diff --git a/include/linux/efi.h b/include/linux/efi.h index ccd4d3f91c98..de05682b233b 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -684,6 +684,7 @@ extern int __init efi_memmap_split_count(efi_memory_desc_t *md, struct range *range); extern void __init efi_memmap_insert(struct efi_memory_map *old_memmap, void *buf, struct efi_mem_range *mem); +extern void __init efi_print_memmap(void); #ifdef CONFIG_EFI_ESRT extern void __init efi_esrt_init(void); -- 2.18.0.huawei.25