From patchwork Wed Aug 9 01:51:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 133048 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2546067vqr; Tue, 8 Aug 2023 20:51:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWPWji3aboMn9G9N5tKOSE0S3yJ/gYNofuLelN+O1K8qgXAc7wX7BwR94jwJZNVx1Y/xbf X-Received: by 2002:a19:6754:0:b0:4f6:47a2:7bb4 with SMTP id e20-20020a196754000000b004f647a27bb4mr926744lfj.60.1691553080506; Tue, 08 Aug 2023 20:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691553080; cv=none; d=google.com; s=arc-20160816; b=K8A/IyQBn558JHbUY4Kw8BV+wiIDiESYH5UM7LKck1r6xEKwOgyebgO8ugQ6p0CrhG TpFjtD9nbkP9DUO7PO7wOSllNbbZ3sDWT58dB/6Xh5cMfYrHrjb4QVJK/DlZ3J+NMbSk 04y8NXLR+FWlIfs3tTvPhw7FsOj4zsjwdjxwnoRk2gEGtnmFEm4sZdcMf0m/lmwEczqV CjEE4I+cQeKGeyKj1UR25t6xpMiZ3LmhXouuo3tlXJUJVt3PpzuaHy/Mp1lIEg4tdh01 N0EKY3YBap4qDaNfKW9YvoGL9IYQsAJnLFhaODrdw3iqz2lv9eCBJwRukLustMzeYjmP uXJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5q2lf0ErqSwJrn3JbgeuhvaoxCnqdWFIkpf1V4h3asg=; fh=7AUu9WDHec3ojD+PBWP8kj3GITT/pOnwiCBaYopXpyU=; b=tqnKc5trPPieW2rvPB32fk4r1GNiYX1RvSsj/zyn4Z0EGjahgSwQqWrNWdbCRPdeWG Lw1a9vNa9gii5R8vriuQ5V0TR7LLc4getK4g0BbyRBfQw/9o8sBd7dpwdGpmaRf9fFUB 1eJA2jSJ8eKvbgWRez4lMyrRn/GiRmXfs1luBFUh5mXyOGsh0S1ceap9zS0rXjd/j2jA 92bVZ02kCbOW+Vv45JPpu/Thd34lfGStsUrmOyPp4Qf/ftwhb5RwA/5fBHsMSO22ud57 umJfdnO/LDLJouwTBA7VYx5ijn4UmqBeGJUjcca+VfwAeAV2up0vXfnxWwhIfcg6CMQx AfDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=KQfNpvZb; 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 q22-20020aa7da96000000b005234b9da80dsi1466330eds.526.2023.08.08.20.50.57; Tue, 08 Aug 2023 20:51:20 -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; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=KQfNpvZb; 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 S231294AbjHIBxR (ORCPT + 99 others); Tue, 8 Aug 2023 21:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbjHIBxP (ORCPT ); Tue, 8 Aug 2023 21:53:15 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75E1D1BD4 for ; Tue, 8 Aug 2023 18:53:11 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1bc7b25c699so13976345ad.1 for ; Tue, 08 Aug 2023 18:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1691545991; x=1692150791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5q2lf0ErqSwJrn3JbgeuhvaoxCnqdWFIkpf1V4h3asg=; b=KQfNpvZbwPfJw4InJH3Gop3jL8C3JwJPDbX7mWsYj121ubZsb8RGRA2aI9F/PwCRVF VythodBAkVElVzcYFFbi1lDli1YK6i88YBAyJ4izWsKPC7TciTmEvVoHSJFMyct3/A1C QCjr27vWn57/CGMNexhGRhDrj7RKrU+Fm1uLuqZAWixGoxJgCb59LKtThbuUpPvCKADL SV/MKjcJ/vt528cSHhB3ZDKQVmxe2Pl4qLNnNm+Usxd5J+XvPi8hxQoSr+RdZwvLVwxq XkZe4sqD/xdLk4MoYZctFEDxxFdlv5Rih9i/apAmP5jgpZqpVJTVwvCWYM3sPWvQD09+ Qnvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691545991; x=1692150791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5q2lf0ErqSwJrn3JbgeuhvaoxCnqdWFIkpf1V4h3asg=; b=T8Xsni5QBDrvEiWIymBKEWfkNWNHmN96XINncg0UJFOI8SvpIhmj4P8aN+9vfmXvUc o/OmrrjheMzQyUJrERn6LPfHm4rXtqU4Lu/wKuUGc88JF47dlPpGWot+9EtuMQNoS1Ap +bjJAVxqh0SsOHglrWZQpPkh1HALDo7S171pEawceme92ZzV+sYrHJhnWSOzt5IYJAlF kok4yF2QsEUMBHSKLjIyBq0uTxV1IUjIPEELTCGfWdr2PKrv/oe1ohRs9hTbHPfl8ChM KtHoQMWBVbGUyd7a1jnqlIlp5rvExjAJZZr8PdQMKY9LMMu2TDc686SHL7nvOIDWpHrK 7fVg== X-Gm-Message-State: AOJu0YztPyVwNK0orRQNtupFji1OGP3/ENcuVD1gpBPpgAEquc69I9WV MJdLnmDBx/hbDXl0/l3P29sfDg== X-Received: by 2002:a17:902:d2cf:b0:1bc:3f9b:d96 with SMTP id n15-20020a170902d2cf00b001bc3f9b0d96mr1444563plc.49.1691545990966; Tue, 08 Aug 2023 18:53:10 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id bj7-20020a170902850700b001b87bedcc6fsm9657591plb.93.2023.08.08.18.53.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 18:53:10 -0700 (PDT) From: Charlie Jenkins To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: charlie@rivosinc.com, conor@kernel.org, paul.walmsley@sifive.com, palmer@rivosinc.com, aou@eecs.berkeley.edu, anup@brainfault.org, konstantin@linuxfoundation.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, mick@ics.forth.gr, jrtc27@jrtc27.com, rdunlap@infradead.org, alexghiti@rivosinc.com Subject: [PATCH v9 3/4] RISC-V: mm: Update pgtable comment documentation Date: Tue, 8 Aug 2023 18:51:09 -0700 Message-Id: <20230809015110.3290774-4-charlie@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230809015110.3290774-1-charlie@rivosinc.com> References: <20230809015110.3290774-1-charlie@rivosinc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773721963047727329 X-GMAIL-MSGID: 1773721963047727329 sv57 is supported in the kernel so pgtable.h should reflect that. Signed-off-by: Charlie Jenkins Reviewed-by: Alexandre Ghiti --- arch/riscv/include/asm/pgtable.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 2611c1324a7c..76907b95109a 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -849,14 +849,16 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte) * Task size is 0x4000000000 for RV64 or 0x9fc00000 for RV32. * Note that PGDIR_SIZE must evenly divide TASK_SIZE. * Task size is: - * - 0x9fc00000 (~2.5GB) for RV32. - * - 0x4000000000 ( 256GB) for RV64 using SV39 mmu - * - 0x800000000000 ( 128TB) for RV64 using SV48 mmu + * - 0x9fc00000 (~2.5GB) for RV32. + * - 0x4000000000 ( 256GB) for RV64 using SV39 mmu + * - 0x800000000000 ( 128TB) for RV64 using SV48 mmu + * - 0x100000000000000 ( 64PB) for RV64 using SV57 mmu * * Note that PGDIR_SIZE must evenly divide TASK_SIZE since "RISC-V * Instruction Set Manual Volume II: Privileged Architecture" states that * "load and store effective addresses, which are 64bits, must have bits * 63–48 all equal to bit 47, or else a page-fault exception will occur." + * Similarly for SV57, bits 63–57 must be equal to bit 56. */ #ifdef CONFIG_64BIT #define TASK_SIZE_64 (PGDIR_SIZE * PTRS_PER_PGD / 2)