From patchwork Wed Jul 26 16:45:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 126517 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp568538vqo; Wed, 26 Jul 2023 10:59:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlGspFWH5Umg1GjuWxtYVAXmK3LnIHdCmF9kCQzAYuF3USlNSeJaEhBascCkNo0Er4rqGqQD X-Received: by 2002:a17:902:ba8c:b0:1aa:d971:4623 with SMTP id k12-20020a170902ba8c00b001aad9714623mr2540817pls.38.1690394350251; Wed, 26 Jul 2023 10:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690394350; cv=none; d=google.com; s=arc-20160816; b=dd9HGoc+RZEENksCAVQV72r/nbNgagPG2CnYoKhv9EV32Fq96QRxhvhOoHhpvm2bWC dMaYYtf7cIXcGuOY+4g2rjW5qD1FKP2aqMV0euAuca+j+tN59VnwRciXjOjn0n5wPmwh LbeiXShtsQTzI7y3d/GXjnJqiQQ09fWg7hbGrgMdQL1ZYI2WJ0eVjtkVr0SAE8p+VdGR cmL5EuWqVPu1b0i+tr2XednOAHKKgf3wZnUFgORgYXj2rd7WvYiDrIaKcuv68bcsBiJK mgxQfdWiZLhPcVS7aQhs8qUsFqBGvZ4YHR5Lsb3z8jHv0SLto3xNQz5F8A/Y2istDvT+ Wc1A== 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=nxXmOdIWe/bZgFmovuliVgy5AL4XQqsEakBY4VilH/8=; fh=7AUu9WDHec3ojD+PBWP8kj3GITT/pOnwiCBaYopXpyU=; b=Zt64tAEghDabKEbIgc2TvnCCzHGGgSI2bLdvTpqx8N4AQE8ga60YaQaUpMaaZr1wZH CK6Cmb2FYN0W8GP2nWalfc65NXaki0TVeSPBv/aMpzcNd4f18ujZHG5IrE6jnzzoZHOm o+c8QsLcnemA9Nwa71dQ67PXdH8xcd63jOQphtxqhj8QY3Dfso8/E/AS+8+VqfyNYVVP VeZfB6c6Td4gBsYQil4Izy9IAQiSYlcMuq0h+ZzPtglrIzkEVOgqRfhuZRIBtHxt2sw9 dV+Onl2mosP0kATlN/EURCDKnUsMNeAJ3OWzQWFos+r8LJJUdb62+MDYxceZMflUxrQk kD0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=uGj1t6oL; 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 l8-20020a170902f68800b001bb94eaa311si8622629plg.567.2023.07.26.10.58.56; Wed, 26 Jul 2023 10:59:10 -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=uGj1t6oL; 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 S231808AbjGZQqu (ORCPT + 99 others); Wed, 26 Jul 2023 12:46:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231656AbjGZQqi (ORCPT ); Wed, 26 Jul 2023 12:46:38 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EE002707 for ; Wed, 26 Jul 2023 09:46:34 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1b8ad9eede0so55359835ad.1 for ; Wed, 26 Jul 2023 09:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1690389993; x=1690994793; 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=nxXmOdIWe/bZgFmovuliVgy5AL4XQqsEakBY4VilH/8=; b=uGj1t6oL4u1fl4y0bUjyIo+gEG6FvyX76N3UvGsKUanjjrHB6wnIUkhEejMij86pkP EVcq1qYhmhAsWKH/bTv86zK02/LQZMQq7g4GucihnDv97RSd4YvXnrbgbDWPGh57Gm43 otyrPfQG7tSPmnn1LK0ZKv6nS+RjBkhyBwtgizouPL3Kq5x8fU1JxqHm8ESNdJya0Equ u60fTChXgviIE+TR2UEeszDN/H3aPv73hS0hvyNcKuH0qJi9wFqWw0PjC0ks4SU85S2Z 5glfdqvmMevya7khD8CyeEfxUGRd305Yi1lCbXYzBjv2vJ/zFMEBiJB9hvll+QMy0/cX T8VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690389993; x=1690994793; 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=nxXmOdIWe/bZgFmovuliVgy5AL4XQqsEakBY4VilH/8=; b=VExBFvCcjcZFwrpB2cHpNl7w08zJEJ5nejHDnJLjkP5y69YZLWD7KJ0jJOvA8kYxA8 bNln9Va2ImZ/tQU7ET/8qmGU4HP/89PvidXrAc5TrUvr/7UwgOpY5g0tabDvhMH3b7Rd BMU8cETsVNfcpPZ5rX2l/Km7SMAPaJ/pRDI4rXHPuYW639MEdO3AYDGorX0NIqpk6ryO /hooHS1m+jcfuGgrEfc8XX9rHv+cDz7lgzDDNl9axpzaxGZ5IScrVdkvNNfFPf8Io3gV QMY8WffS64o+Cxnj64U7Q3J/IGGmweU4gtutQnbJ0Zp+SbVaNmd9luI+V6kg0JkHnLn6 veHQ== X-Gm-Message-State: ABy/qLaZF2hPSmJsjYkbuVzvkm3t9DPfy13NzXgg8t5Gv26vkcPBkisj 6fiqowg39+4TyWRrzv/KGgBNDA== X-Received: by 2002:a17:902:c205:b0:1b5:219a:cbbd with SMTP id 5-20020a170902c20500b001b5219acbbdmr2429756pll.3.1690389993609; Wed, 26 Jul 2023 09:46:33 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id h5-20020a170902f54500b001bb6c5ff4edsm11628870plf.173.2023.07.26.09.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 09:46:33 -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 v7 3/4] RISC-V: mm: Update pgtable comment documentation Date: Wed, 26 Jul 2023 09:45:57 -0700 Message-ID: <20230726164620.717288-4-charlie@rivosinc.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230726164620.717288-1-charlie@rivosinc.com> References: <20230726164620.717288-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, T_SCC_BODY_TEXT_LINE autolearn=ham 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: 1772506946334297770 X-GMAIL-MSGID: 1772506946334297770 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 530f6a171a2b..cd09ccd876b9 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -841,14 +841,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)