From patchwork Fri Jul 14 00:14:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 120150 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp2181520vqm; Thu, 13 Jul 2023 17:38:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlFKG/QRujUbPBvx6OVFbDvUb00pi08gVrHezYiBIvbUXIHIRyifXFsuNyw4lIn3uiXLrEzk X-Received: by 2002:a2e:b611:0:b0:2b7:2066:10e1 with SMTP id r17-20020a2eb611000000b002b7206610e1mr2703912ljn.0.1689295125817; Thu, 13 Jul 2023 17:38:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689295125; cv=none; d=google.com; s=arc-20160816; b=HtgrQ5nA+4KhPctlZ/BvNz8FD3pHI+9u0Rd54Tnh2Co0VPvimci8laas4+yDaT2L7u I8OsuzWbCWoYpGcNUkqM9/ngckECWp8/5+F+1Z8i4p1kOLOzXy8i+Sm0tctQNzAwaXTL g3+Lhn467R3axQvJ3+PC6WXxl2kfTSyoF5rFkGtUg8K02gYHm9bxvP2LCr/B+s5Y3td7 W9k4+4h67K6yYCHIvPNNXlPsh2axc4fj1nhZyVDIcZ6R4ug+N1hMo6Y5w8nVZc+IESak qKI4iJoYSx/bSqIpJ+Pqnc5E2oNM5frRaxckdIFfh1yS9ta3YbWX39gtNyHLa6R9OPgL Gv2A== 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=WogNqZmM5qIDEUwvyRv9RC9FRo2r68Wx4DIsyw3FtoM=; fh=My2jiibqoUeMwsqLbgcWgl692t5ymcXdwYlfrhkAJHk=; b=TFlWVB0XBs016vcI9D+KrT/TCSIregmghzNxf9RBGPIYopEZg+2Gg/T2i5fCR0dgFu v0DsT9Z+HEXB+5vPA/25BWs5FqsljXTWhR8GsMPphEy+XEfGG3CE3DoChGyZ7VjNRi+d pfb/xC0vqgIAXfX6GAELvmQVKdG5ZGK/32ZeaILyHYSQQL/pOmwPu80nXsuY1rL5BVkZ Z5m+TSGByazwg7jt0oXkT8WUtGX8KNGj1E+w0E7XWMrjIr0KBw3d1LBYctyXH3xSfqVR gwJxHG3yq1n8cC/2qCnoP7lGhT/tXsCvcyBYk1fb1w+h0dYxdrz4MmNvFDVbCS8/ubQK PDAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=scmvmusi; 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 qu15-20020a170907110f00b00992b2a28ef6si7614713ejb.25.2023.07.13.17.38.22; Thu, 13 Jul 2023 17:38:45 -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=scmvmusi; 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 S234383AbjGNAPJ (ORCPT + 99 others); Thu, 13 Jul 2023 20:15:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233757AbjGNAPE (ORCPT ); Thu, 13 Jul 2023 20:15:04 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F05372D65 for ; Thu, 13 Jul 2023 17:15:00 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-666ecf9a081so1320354b3a.2 for ; Thu, 13 Jul 2023 17:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1689293700; x=1689898500; 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=WogNqZmM5qIDEUwvyRv9RC9FRo2r68Wx4DIsyw3FtoM=; b=scmvmusinfT3X+K4TbCSiNrHD6GpfF3g/xu+9lahYYjU4ktFpp9PuohAB7wYjo2/7I /Mw7Dgl25dGudOqR4ayvcdQwHPhIOUDVymcob+uLiwh7kXLYl9glDGllZn9xoAMoP1is JCHFj5AIY7Nq6ca/fp7M1KmHBu5NUIQcKKnZx+xUDj2awa23VFRB8c4lTb/leJGEhfER 4S0RS8ULwsXWaVxCTPqOQTgpYI4hHeBp8dZ5ZB4/0RGM+X4cJLHMcheFvejUGBiL9t9M gCwPO8pH+w5DPvkfsvoLXokFvSLh0QIFcQB6sb4P+NguJuj4IrWxEgEI6vt33bo0OBbj FTzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689293700; x=1689898500; 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=WogNqZmM5qIDEUwvyRv9RC9FRo2r68Wx4DIsyw3FtoM=; b=SoLUPOIdd9gFqPJ0+XGG0aQorYN+ppit10kVtE/m5mvaBTRSXuW+zd/+sYm9bjVVWX dOb1zdq4ZBXDifDiDch7nvI6dVUOmDWbxvqFVcVI/ZBtUiUAOl5vdBMH31HIoFtqpe3M mtpFkNM2BeanXSmWRAE3HMhJQeKS8lFLk5BBsUaP/Frh2UWZ391MeiJ1dPukOwN5ewTK EJluNYUG6rjUXI0538eTBRDAwOQumkgbmyd3AHDxAIWRuRIHnJ71+sz9SBddLbh9fxEp n1DRTJ5LO/eoC7DbLbkvMNLOBz99goVOOu/nB+W/yJYcwuxXcAhdgF/8JfF7Yr1xl6a2 dvNQ== X-Gm-Message-State: ABy/qLbeCArjzRVZutnPtY5mO6jhP4rS5L/IofpwXu3TGiRfA8V2MNME PySppDrSdhN8uZJZdWJaGpWWpCFqpj9bO/I5f6M= X-Received: by 2002:a05:6a20:1445:b0:130:52c5:5123 with SMTP id a5-20020a056a20144500b0013052c55123mr3737553pzi.3.1689293699862; Thu, 13 Jul 2023 17:14:59 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id x25-20020aa793b9000000b00673e652985esm5938107pff.44.2023.07.13.17.14.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 17:14:59 -0700 (PDT) From: Charlie Jenkins To: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.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 v5 3/4] RISC-V: mm: Update pgtable comment documentation Date: Thu, 13 Jul 2023 17:14:02 -0700 Message-ID: <20230714001430.75798-4-charlie@rivosinc.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230714001430.75798-1-charlie@rivosinc.com> References: <20230714001430.75798-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_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: 1771354325991462534 X-GMAIL-MSGID: 1771354325991462534 sv57 is supported in the kernel so pgtable.h should reflect that. Signed-off-by: Charlie Jenkins --- 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 e13f5872bfe9..28660bab754c 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -840,14 +840,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)