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 X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1491BC432BE for ; Wed, 28 Jul 2021 07:22:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ECFEF60FC0 for ; Wed, 28 Jul 2021 07:22:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234901AbhG1HWc (ORCPT ); Wed, 28 Jul 2021 03:22:32 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:7755 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231949AbhG1HWa (ORCPT ); Wed, 28 Jul 2021 03:22:30 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GZQ276VbKzYhPw; Wed, 28 Jul 2021 15:16:31 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 28 Jul 2021 15:22:16 +0800 Received: from [10.174.178.247] (10.174.178.247) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 28 Jul 2021 15:22:13 +0800 Subject: Re: [PATCH] riscv: fix the global name pfn_base confliction error From: Hanjun Guo To: Kenneth Lee , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Anup Patel , Atish Patra , Kenneth Lee , Kefeng Wang , "Vitaly Wool" , Guo Ren , "Jisheng Zhang" , Mike Rapoport , Nick Kossifidis , , CC: References: <20210728064318.375747-1-nek.in.cn@gmail.com> <0b813cde-ca37-9b83-c0c5-ce9f6b8eab3c@huawei.com> Message-ID: <27b3ce52-5d88-90e3-8509-c032bda1f559@huawei.com> Date: Wed, 28 Jul 2021 15:22:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <0b813cde-ca37-9b83-c0c5-ce9f6b8eab3c@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.178.247] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/7/28 15:13, Hanjun Guo wrote: > On 2021/7/28 14:43, Kenneth Lee wrote: >> From: Kenneth Lee >> >> RISCV use a global variable pfn_base for page/pfn translation. But this >> is a common name and will be used elsewhere. In those case, >> the page-pfn macro which refer this name will refer to the local/input >> variable of those function (such as in vfio_pin_pages_remote). This make >> everything wrong. >> >> This patch change the name from pfn_base to riscv_global_pfn_base to fix >> this problem >> >> Signed-off-by: Kenneth Lee >> --- >>   arch/riscv/include/asm/page.h | 4 ++-- >>   arch/riscv/mm/init.c          | 6 +++--- >>   2 files changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/arch/riscv/include/asm/page.h >> b/arch/riscv/include/asm/page.h >> index cca8764aed83..8711e415f37c 100644 >> --- a/arch/riscv/include/asm/page.h >> +++ b/arch/riscv/include/asm/page.h >> @@ -79,8 +79,8 @@ typedef struct page *pgtable_t; >>   #endif >>   #ifdef CONFIG_MMU >> -extern unsigned long pfn_base; >> -#define ARCH_PFN_OFFSET        (pfn_base) >> +extern unsigned long riscv_global_pfn_base; >> +#define ARCH_PFN_OFFSET        (riscv_global_pfn_base) >>   #else >>   #define ARCH_PFN_OFFSET        (PAGE_OFFSET >> PAGE_SHIFT) >>   #endif /* CONFIG_MMU */ >> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c >> index a14bf3910eec..2ce4e9a46ca0 100644 >> --- a/arch/riscv/mm/init.c >> +++ b/arch/riscv/mm/init.c >> @@ -228,8 +228,8 @@ static struct pt_alloc_ops _pt_ops __initdata; >>   #define pt_ops _pt_ops >>   #endif >> -unsigned long pfn_base __ro_after_init; >> -EXPORT_SYMBOL(pfn_base); >> +unsigned long riscv_global_pfn_base __ro_after_init; >> +EXPORT_SYMBOL(riscv_global_pfn_base); > > Just nit: I didn't see any driver in kernel refers to > the riscv_global_pfn_base, can we just remove the EXPORT_SYMBOL()? Sorry, I'm wrong, will be used by ARCH_PFN_OFFSET...