Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5090560rwb; Tue, 8 Aug 2023 20:53:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6Apo+SikCg/n9t2jdEVELpHNTa330opbc45fu8pmgBV5I8UzasvzfqE9zGL9CcBGwBLSi X-Received: by 2002:a05:6a00:1d94:b0:687:8417:ab51 with SMTP id z20-20020a056a001d9400b006878417ab51mr1277982pfw.8.1691553238216; Tue, 08 Aug 2023 20:53:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691553238; cv=none; d=google.com; s=arc-20160816; b=fa3dIFLaPeC22fFjcCGh65zyKk9pEjLqXMBQDzefK0nkTVltnweRub+64FXLyhP+vc tOAe0Oii6S43t7j9Q+fWnUOO4Bt3MPmzvdewBagDjcHXeJiUM2u26nuJp0XmmprcQhN5 SWyIJY1AxGhQ/sNc5w53poVdBqNuxtXWMEpTrfYFoWrhN4MvxPrPvwHe5qA1kOMpF4xq AbSKO83A7PcYK/LCgpJfjmRDFZ2CHViuADscunKza1dCZ382X1HQoSHmA59m7gaToUA+ oyG0w+Vo5JWcb6DWXFqnNcMBRD2mokM+ioESCpEyFBCC0W+RHIE4IV+FtuoNwxBKN223 gYYw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g22-20020a056a0023d600b006873b49ae06si8523327pfc.287.2023.08.08.20.53.46; Tue, 08 Aug 2023 20:53: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; 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 S231351AbjHIBxR (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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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) -- 2.34.1