Message ID | 20230809031023.3575407-1-songshuaishuai@tinylab.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2547947vqr; Tue, 8 Aug 2023 20:57:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHt/Fu0xicfguHRScYo53KTGlyCHpl42wras/avS5Z6b7QiUogNc75AFEXWQ9tXA/2HsQhp X-Received: by 2002:a05:6a20:8f0b:b0:12f:dc31:a71e with SMTP id b11-20020a056a208f0b00b0012fdc31a71emr1912400pzk.56.1691553478102; Tue, 08 Aug 2023 20:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691553478; cv=none; d=google.com; s=arc-20160816; b=XPh98SRYz/zBeez5To1D5NRcS70EecPT9pmf5wMJ+panoSCjP5Z262Zw0iNspWCcwT T6p7ihGHL9+Iy7ZLOc4JiJLjnsoEJvHUSExHXOQYnIitj4R0qwdphr6mBH8/N1sIZ0gd iUepJQzcZD44CFdlIeDAhiJu+qaTaEomUL5REh+aJCu4a7SgzMaIPilbGZylGeHEFmLT WivVMRi/6/IbWyI7+nV2PFDaf2hhZy2Nls/N3SIQFNemZSRIDLZzZ3JnBbyZE1cZy/dw jSa8/tD4lYeL998OTHUHexyTDPlT5wY5pM5mGdpudnGXtDWL+Pa9FHBz7Es7ZQw0CnhJ McjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=1ZrBke0WgMBibWYclnNaStMELJURGf8OQ+4OrBv++kA=; fh=w/zWYm2VqkF/yP2EptOqtkVoM3zWRakb5lTWWN3g6nM=; b=0R9WGJQl7G6NC3mEDfdvLalALWG/uaCpkE67FPACaqj8k1oo/E0tpvCKgycC8052d7 LCoMgIOrQgqPpXy3sIjiEm1BE8IV2c/vRI3HsmMVGlDSvYIBDkcojmjSvYbKBDybtuMK Oth6kKaa9Nxcu4lY19txTvO3PxCTBqwN8AEiBH5vSe+ljfP47tMLz0YAtTvv3MoOLqyU m0krNr3xG4RTRXa5gjG8N7rjaoZKGIdbamlxFkR9TegiQB/PZ5S1sptHIVa0RQEfUJmt sOAnC5gniuS6SGc3bQkcWW4wxESL9Fk2GdjL7JLh9LFHeLzHnHFfTeRZN54c3cc7eL2y MRXg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o1-20020a056a0015c100b0068753f6a789si8544862pfu.349.2023.08.08.20.57.44; Tue, 08 Aug 2023 20:57:58 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229848AbjHIDL1 (ORCPT <rfc822;aaronkmseo@gmail.com> + 99 others); Tue, 8 Aug 2023 23:11:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbjHIDL0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 8 Aug 2023 23:11:26 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4088A10F7 for <linux-kernel@vger.kernel.org>; Tue, 8 Aug 2023 20:11:22 -0700 (PDT) X-QQ-mid: bizesmtpipv601t1691550655tu60 Received: from localhost.localdomain ( [255.156.107.10]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 09 Aug 2023 11:10:46 +0800 (CST) X-QQ-SSF: 01200000000000B0B000000A0000000 X-QQ-FEAT: w8KaQ9l6q4grTOwgxeVA4itTHPKxUqvpEz73M6tPxHUQ8KoVfsJ5neYQsaOtB sKqbSt0Iy2eW9k9FsiD844IrMgJ6pC+H0KApXrbpjfoxoyHhD35EO7ouoASe2znGodHCFVf UAwDL5dASfiiZxI5FnhQRWZ1g61ZbXpLDwsrex2j3aWka30tdkqaKs5FdfFnkjaj9wZZM22 PCmQjIaCFnhR8mDxc0PtsInUuntMT0xezfQqv26+OppI5TpjpUZsb8KRXoplJG3em2ScNQB vNUpGg5wt/667B0u/ysaCSVGdKH3wQIkGve6QetD4LlfpG23M3tgbCUcPFKZzc8qHYMH9OG o9XfejTFv5tfMrmZQ0= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 9490210224257605777 From: Song Shuai <songshuaishuai@tinylab.org> To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, ajones@ventanamicro.com, alexghiti@rivosinc.com, anup@brainfault.org, guoren@kernel.org, samuel@sholland.org, rppt@kernel.org, suagrfillet@gmail.com, panqinglin2020@iscas.ac.cn Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: mm: Update the comment of CONFIG_PAGE_OFFSET Date: Wed, 9 Aug 2023 11:10:23 +0800 Message-Id: <20230809031023.3575407-1-songshuaishuai@tinylab.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpipv:tinylab.org:qybglogicsvrsz:qybglogicsvrsz4a-0 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_ILLEGAL_IP, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773722379473540965 X-GMAIL-MSGID: 1773722379473540965 |
Series |
riscv: mm: Update the comment of CONFIG_PAGE_OFFSET
|
|
Commit Message
Song Shuai
Aug. 9, 2023, 3:10 a.m. UTC
From: Song Shuai <suagrfillet@gmail.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@gmail.com> --- arch/riscv/include/asm/page.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Song Shuai <songshuaishuai@tinylab.org> 于2023年8月9日周三 03:12写道: > > From: Song Shuai <suagrfillet@gmail.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@gmail.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) > #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 > Ping...
On Wed, Aug 9, 2023 at 11:11 AM Song Shuai <songshuaishuai@tinylab.org> wrote: > > From: Song Shuai <suagrfillet@gmail.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@gmail.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 ? > #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 >
在 2023/9/14 12:59, Guo Ren 写道: > On Wed, Aug 9, 2023 at 11:11 AM Song Shuai <songshuaishuai@tinylab.org> wrote: >> >> From: Song Shuai <suagrfillet@gmail.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@gmail.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 >> > >
Hello: This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <palmer@rivosinc.com>: On Wed, 9 Aug 2023 11:10:23 +0800 you wrote: > From: Song Shuai <suagrfillet@gmail.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@gmail.com> > > [...] Here is the summary with links: - riscv: mm: Update the comment of CONFIG_PAGE_OFFSET https://git.kernel.org/riscv/c/d42469b616b1 You are awesome, thank you!
On Thu, Sep 14, 2023 at 2:52 PM Song Shuai <songshuaishuai@tinylab.org> wrote: > > > > 在 2023/9/14 12:59, Guo Ren 写道: > > On Wed, Aug 9, 2023 at 11:11 AM Song Shuai <songshuaishuai@tinylab.org> wrote: > >> > >> From: Song Shuai <suagrfillet@gmail.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@gmail.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. I mean: #define PAGE_OFFSET_L5 _AC(0xff60000000000000, UL) #define PAGE_OFFSET_L4 _AC(0xffffaf8000000000, UL) #define PAGE_OFFSET_L3 _AC(0xffffffd800000000, UL) #define PAGE_OFFSET_L2 _AC(0xC0000000) #ifdef CONFIG_MMU #ifdef CONFIG_64BIT #define PAGE_OFFSET kernel_map.page_offset #else /* CONFIG_64BIT */ #define PAGE_OFFSET PAGE_OFFSET_L2 #endif /* CONFIG_64BIT */ #else /* CONFIG_MMU */ #define PAGE_OFFSET 0x80000000 #endif /* CONFIG_MMU */ kernel_map.page_offset = _AC(PAGE_OFFSET_L5, UL); The kernel_map.page_offset is no use to CONFIG_32BIT. Remove the CONFIG_PAGE_OFFSET, and put all PAGE_OFFSET* together to ease maintenance and reading. > > 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 >
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) #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)