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: 13328366 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DF2EC001DC for ; Wed, 26 Jul 2023 16:46:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0E5156B0081; Wed, 26 Jul 2023 12:46:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 023986B0082; Wed, 26 Jul 2023 12:46:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DBCBE6B0085; Wed, 26 Jul 2023 12:46:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A17A46B0081 for ; Wed, 26 Jul 2023 12:46:38 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C58291202E6 for ; Wed, 26 Jul 2023 16:46:37 +0000 (UTC) X-FDA: 81054341634.28.AB1E3E9 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf29.hostedemail.com (Postfix) with ESMTP id DA3B8120024 for ; Wed, 26 Jul 2023 16:46:34 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=uGj1t6oL; dmarc=none; spf=pass (imf29.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=charlie@rivosinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690389994; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nxXmOdIWe/bZgFmovuliVgy5AL4XQqsEakBY4VilH/8=; b=T6ZCd5KLMOLf5rvQDFOuKPMWZvAGWsmgmYUoSxqVNVDEPUHfXWD/jGQ3UxHuEu1NSm5sdc vjIumL67MA50aZkrecVjL8WqSle37ZUkxV9xWYaocOW6Idtb6dAvnXq1pIhCOgUZkirTol tS/qapQKqESdpDthuknfRRNvfB7HMtk= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=uGj1t6oL; dmarc=none; spf=pass (imf29.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=charlie@rivosinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690389994; a=rsa-sha256; cv=none; b=yD+ytAIDwSDOPNMa9ELqbOUjXhOQTrRGW0HtosIUxURLSKsv605zD6toSY+X8kQShBwyGO OeLddiqHWjWRTP8By94WbHtexUgKrgQ+C14Jxn+StzGp9abfVeJyRVLg2aLHcavUKnKEhb cXbgZGR+DvkHRAqJfMYzrWf5jiXvVyU= Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1bbd2761f1bso4629065ad.2 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=W0oAVFgT5HCVUR5C98ZQYjosHCzT6SqQodDTQSl9knxLNrc90FwMtCzSZ4Mg2jFOBz 9+Tn/T5RDkKepI2mQUfhx503mE769MEYl5g9epyroPwhoQTl0Co8zqN6AmLHaIfJ1NHz J31KtVntwv/icZHohQlR0Woo+fBggv0ABnwEtE1daNJyhV4bVsX4qf+JP9sILn5dCNyl Agzm+9ojZh389685Z1O2HIogdKmX+ZBQ8ul8qsuNmSEH9ibWrPyIi8sKW1r0dhXwpVCF djAJbiAMLDP/oMVbToe2r0F8Ci4IbYnAB5jZ3CZ7gA52xbLgqaEPeLox+jnWPyj75Xcu 7L6Q== X-Gm-Message-State: ABy/qLaMhZPLR4SWNShGwAfI88uK8kvKUnEEMJlXnPDvHrL1YL+X1FP2 KH2PAQF822rlUEhheIaCW5Igkg== X-Google-Smtp-Source: APBJJlHd8ZanXubRsLvs8LnpqdeDXtlGfjvqC1HSJQRHauQPQgT6PVzi7mdT5yfnVwFo9B2eoHwlEA== 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-Rspam-User: X-Stat-Signature: 86diy1fco7pi6fc4ofnkqrz1tuuze95a X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: DA3B8120024 X-HE-Tag: 1690389994-55882 X-HE-Meta: U2FsdGVkX1/8PX493DgLCWXwmGa4FG9X2m659XqZeuQSe3ZnXVKnv0javtV86lGggbmgebcLnkzdx1ig/DlLDnstVhe7+hjg8Q3DEw1cLd1QxrQIEbPr6oleJppgxKUpsLXP3gpuu3IDrZsVm7KaR8bwZYdwHB04oIAKCJwGGlmBD2E1MHaEaKC9ka0mXrujFsQSwMz9WuIaUA1oMOdSgTw0XPxZXu3ZOUb040FPnKbSsrVtCH34Z0w9YniCam3LqpfWjVPq7dI/JAtGe4c06QWMXy80JMI8b8UZoiEfcFh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NeJmqCRrSOe2rqaUno+zw63MWl5Epyzi7H2DEdFT8Z3yYv8KHJERVB5ijeWg8ESpDvUORDjZwXucsuV4whovP4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000996, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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)