[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <A1D410BE9DD1128F+45f92224-dc0f-0bfd-d122-fbbcac48eaf3@tinylab.org>
Date: Thu, 14 Sep 2023 14:51:43 +0800
From: Song Shuai <songshuaishuai@...ylab.org>
To: Guo Ren <guoren@...nel.org>
Cc: paul.walmsley@...ive.com, palmer@...belt.com,
aou@...s.berkeley.edu, ajones@...tanamicro.com,
alexghiti@...osinc.com, anup@...infault.org, samuel@...lland.org,
rppt@...nel.org, suagrfillet@...il.com, panqinglin2020@...as.ac.cn,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] riscv: mm: Update the comment of CONFIG_PAGE_OFFSET
在 2023/9/14 12:59, Guo Ren 写道:
> On Wed, Aug 9, 2023 at 11:11 AM Song Shuai <songshuaishuai@...ylab.org> wrote:
>>
>> From: Song Shuai <suagrfillet@...il.com>
>>
>> Since the commit 011f09d12052 set sv57 as default for CONFIG_64BIT,
>> the comment of CONFIG_PAGE_OFFSET should be updated too.
>>
>> Fixes: 011f09d12052 ("riscv: mm: Set sv57 on defaultly")
>> Signed-off-by: Song Shuai <suagrfillet@...il.com>
>> ---
>> arch/riscv/include/asm/page.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/riscv/include/asm/page.h b/arch/riscv/include/asm/page.h
>> index b55ba20903ec..53c00164c042 100644
>> --- a/arch/riscv/include/asm/page.h
>> +++ b/arch/riscv/include/asm/page.h
>> @@ -33,8 +33,8 @@
>> #define PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
> Why not remove CONFIG_PAGE_OFFSET and define PAGE_OFFSET_L2 ?
>
CONFIG_PAGE_OFFSET holds the first memory address regarding the
different CONFIGs (MMU,32BIT,64BIT).
As for 64BIT, it actually represents "PAGE_OFFSET_L5" for Sv57 page mode
defaultly. And the real page mode may be downgraded from kernel cmdline
or restricted by the hardware, so the PAGE_OFFSET_L3/L4 was defined to
set the real PAGE_OFFSET.
IIUC, the "PAGE_OFFSET_L2" you specified might be the "PAGE_OFFSET_L5" I
previously mentioned,
If not, the PAGE_OFFSET_L2 semantically means the page offset for
32BIT's default Sv32 page mode,and it has already been held in
CONFIG_PAGE_OFFSET too.
So IMO there is no need to touch CONFIG_PAGE_OFFSET in this context.
Please correct me If I'm wrong.
>> #endif
>> /*
>> - * By default, CONFIG_PAGE_OFFSET value corresponds to SV48 address space so
>> - * define the PAGE_OFFSET value for SV39.
>> + * By default, CONFIG_PAGE_OFFSET value corresponds to SV57 address space so
>> + * define the PAGE_OFFSET value for SV48 and SV39.
>> */
>> #define PAGE_OFFSET_L4 _AC(0xffffaf8000000000, UL)
>> #define PAGE_OFFSET_L3 _AC(0xffffffd800000000, UL)
>> --
>> 2.20.1
>>
>
>
--
Thanks
Song Shuai
Powered by blists - more mailing lists