Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3720976rdb; Wed, 13 Sep 2023 23:53:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMxY5cQMzm+T69bGV/8HWzWMPiE1byU1sXNCIoAgHR+29Kb6FrzkvDXLmTiRdC7rfcrwm3 X-Received: by 2002:a0d:e80a:0:b0:592:58c4:1810 with SMTP id r10-20020a0de80a000000b0059258c41810mr5163623ywe.23.1694674431147; Wed, 13 Sep 2023 23:53:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694674431; cv=none; d=google.com; s=arc-20160816; b=MlIU1RtqeSz6X1WK020ekJy7DhI8Fz9kqtJmNWj1HRYMplo9dJgvmLThNHwh+SjWv2 ISmmOCw4SCLeJBvqwvcbZPr2Wk5V//QlwuxauCy+6VtL2YbL1r3oohb0WQJteG1rcnvd +nK/k0do6C63z1G7r9q0U8SeM4Cav3Gt7cYH35ZY15IsmcxwESeTDq2cn0aidn1VTbTE wUP85NLfI4FqWdUBRqSM8/vLI82DVpafLRdylwyED5VbySBAfp2wLgkAiPzido5JtJLL rptt4kwos1NEf2d7sK+2ZIVr3rUvplWEvIvSQKGHcB3aafjiZ/ycslNL8wqv7lqtKEYa 0pEw== 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 :in-reply-to:from:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=db+kqqcBRv2g9DOQuoNFEaRufZYBOAN1uW+D64dRQRg=; fh=mHNfAgNQPSNzMQOhtXEwQihvuKXxZ+BaN5Gseli2fhU=; b=wlIQoDuBhDgHE7gnhUxSlHP3pD2zCpUNjr3Cf4cdina20xvT5RU5RhiDosbSs4rnty +h4MUjCdGCOMae1RkSsWxKVmWeF6kfEoL3tTmgF2IkgTtj9TayeiA96UFgqXTLfc3zkl a9aTv18mMMRrLS8bRHh0ck88mCmZ13eM924ozX/J3I6056DWb6sILQ4pIsgJ/ZIjuzFW nwxlkLO9Zg6VJUbBKJJXEsI6MHo6R8AZuDFeyUh8zdtPVUBbb9k273OhXfn0hv9ZUa9R MbbfdjSAgu40TI45zC1agRICvmFMOLVWxGAYJyROaNi9XBWTBsbdTD+HR81fZPL4GAdH nMZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id q3-20020a056a00084300b0068e4a646d2csi1004636pfk.252.2023.09.13.23.53.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 23:53:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CF45F82AE933; Wed, 13 Sep 2023 23:52:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234331AbjINGwf (ORCPT + 99 others); Thu, 14 Sep 2023 02:52:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232171AbjINGwd (ORCPT ); Thu, 14 Sep 2023 02:52:33 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F9D2CCD for ; Wed, 13 Sep 2023 23:52:28 -0700 (PDT) X-QQ-mid: bizesmtp66t1694674308t5grj0hy Received: from [10.4.6.71] ( [221.226.144.218]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 14 Sep 2023 14:51:44 +0800 (CST) X-QQ-SSF: 00200000000000B0B000000A0000000 X-QQ-FEAT: QityeSR92A1mgVQ1XhhOgX/qTsqmJVLJ7VlmlQ3v1R2RSAEbV4tpASXMJp4g2 yGFGg5xIL3mrCSntp03UvnjCgfi7+CyZZsjhD62l4W2UthZFj6hCCoRBLIcdSEJ6/vuV+lT Ic0jLhbFaMKt5QDTyM7x7VtqSOyEzlqH0OrxXDmIiNQ7K4cu3b4qmR9K99wliy3iQSADrle lpuqHw+IhAIXQVnssRND95on4lPUPHi3/Jaepea9VthPflXPomLIUHxBCl5rc8eSUh51x+x qQISC9P/FeE+Dmsal4yU9HjxUjWjQfcuh9CYnYGhz5Jt85x56CQXOcZw3cfjaDRNyXOtfj9 irew9dQ49ErHnWb1kjDxT/vA9A318kZbmTUkIwui7+eONoWPtQ= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 3595057428919100681 Message-ID: Date: Thu, 14 Sep 2023 14:51:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH] riscv: mm: Update the comment of CONFIG_PAGE_OFFSET To: Guo Ren Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, ajones@ventanamicro.com, alexghiti@rivosinc.com, anup@brainfault.org, samuel@sholland.org, rppt@kernel.org, suagrfillet@gmail.com, panqinglin2020@iscas.ac.cn, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230809031023.3575407-1-songshuaishuai@tinylab.org> From: Song Shuai In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz4a-0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Sep 2023 23:52:35 -0700 (PDT) X-Spam-Status: No, score=-0.6 required=5.0 tests=FORGED_MUA_MOZILLA, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 在 2023/9/14 12:59, Guo Ren 写道: > On Wed, Aug 9, 2023 at 11:11 AM Song Shuai wrote: >> >> From: Song Shuai >> >> 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 >> --- >> 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