lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27b3ce52-5d88-90e3-8509-c032bda1f559@huawei.com>
Date:   Wed, 28 Jul 2021 15:22:13 +0800
From:   Hanjun Guo <guohanjun@...wei.com>
To:     Kenneth Lee <nek.in.cn@...il.com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Alexandre Ghiti <alex@...ti.fr>,
        Anup Patel <anup@...infault.org>,
        Atish Patra <atish.patra@....com>,
        Kenneth Lee <liguozhu@...ilicon.com>,
        Kefeng Wang <wangkefeng.wang@...wei.com>,
        "Vitaly Wool" <vitaly.wool@...sulko.com>,
        Guo Ren <guoren@...ux.alibaba.com>,
        "Jisheng Zhang" <jszhang@...nel.org>,
        Mike Rapoport <rppt@...nel.org>,
        Nick Kossifidis <mick@....forth.gr>,
        <linux-riscv@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
CC:     <wangzhou1@...ilicon.com>
Subject: Re: [PATCH] riscv: fix the global name pfn_base confliction error

On 2021/7/28 15:13, Hanjun Guo wrote:
> On 2021/7/28 14:43, Kenneth Lee wrote:
>> From: Kenneth Lee <liguozhu@...ilicon.com>
>>
>> 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 <liguozhu@...ilicon.com>
>> ---
>>   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...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ