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: 13347311 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 44246C04A94 for ; Wed, 9 Aug 2023 01:53:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 52E656B0078; Tue, 8 Aug 2023 21:53:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4DEB56B007B; Tue, 8 Aug 2023 21:53:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 330D18D0001; Tue, 8 Aug 2023 21:53:14 -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 250546B0078 for ; Tue, 8 Aug 2023 21:53:14 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 002E112087E for ; Wed, 9 Aug 2023 01:53:13 +0000 (UTC) X-FDA: 81102893466.30.6F04273 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf19.hostedemail.com (Postfix) with ESMTP id 15A7F1A000C for ; Wed, 9 Aug 2023 01:53:11 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=KQfNpvZb; spf=pass (imf19.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=charlie@rivosinc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691545992; 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=5q2lf0ErqSwJrn3JbgeuhvaoxCnqdWFIkpf1V4h3asg=; b=8ky7CoxWeak0D6J2oiwH49uynKYlK+KBbWtt49T16LIi67spD0ZH9K9ThzaW5CwdlhC5ny gBCHRjWj4joG/tiQqmNssQ3w8mIhCe5miPv45Dk/+JqB0DGkDVanmnvvo5fk9aTdncLlqk nA/s21nTLca4z+hwZ1UH65FJUY+Tu3o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691545992; a=rsa-sha256; cv=none; b=dBzhgrDWa6PhMZSqMlpRoBL215BZa8eyurJGaULVMkKoG8If4N1JbgasYvBlVIaSWRLy0I L3qEprwfo7y7ilOvtzkOhtHQPM5Q4+OvX0OaXKSVFBsEznXMoQZPnJ68nxU4jjHRSODV3b qb9aLE85r+WOQ1LsSbgB34Er5RuLv7M= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=KQfNpvZb; spf=pass (imf19.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=charlie@rivosinc.com; dmarc=none Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1bc83a96067so8323495ad.0 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=B+FvD5sMJLROZsdsMhkc0/9ygtqVFiH+ODKtLG5DpvttnfkGyYRJgscdHHzxFC5Li9 RwIlH4FyV5E1BoHyza1eFV63pu/vnfutnnvB5rYQqxXSn+6YfCKDyXk03Gb/0EwyRl5L FYg9rTW8R2FDF+EEMxzngqCdUj7EZ/HHtP+8v4EWPgX6yV3UcGlKGIHZD9CyGM6p5B21 BGETX0dsPh9cNqdERcqSv7ZOvU/ic72fQmxfirVZk7A+QoBLK/K1pbuaSaur77FTvNuZ Fqv2d7fPaO9sNBqFD4/qSDKyK0zpgMEN6RIjiqCFjOliv9vIqSndB/gAmgH7Nt+KLr+A fyyQ== X-Gm-Message-State: AOJu0Ywg5gc6OdEImREYnpuU0cncIcz4ingA7ccQ6H8jMcOgS6obax0J uimSABDDGdfZgyEww1mTaoBzVg== X-Google-Smtp-Source: AGHT+IGg+v5KFzlU+jQrk/Y4IPjZqAfK6IzCZuHeB5tm9d5fjhnx1QdE7SY5R0FlUS9hkHWQ+fZbQA== 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-Rspamd-Queue-Id: 15A7F1A000C X-Rspam-User: X-Stat-Signature: d1njajkc8fbdtxdtxssb7bysj8bjxogx X-Rspamd-Server: rspam03 X-HE-Tag: 1691545991-330420 X-HE-Meta: U2FsdGVkX19Fzs02vXp2LWQN8VIZvbrE7KBQclpYu5+ImnVGZjs4bM4l5YzLGH2yZ1kAMq7b34UqXVzDX+juEkEyT5R3AJAg4ThbqU3cZZBZmlY7jH/3nFsSJr8Z9VNvdvcsiGuSCavdVFrOAMY5YRMRp2Bm7qQxZwjD1B3pdWBMhJLURfWMpsG8f8NCZidNJS9FB7c4W77+kcHaHaBw2RuV2tNuJRE4IxIdO18FvKwlw7KYo3FOQOQ2n7OzjXgzqE2KqdY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WaztMp6seAwrgGVYZOsJmtXhVo1X88057RepjxZLlhsaumfx5gQY81rEYZ8IKGYnN/P77CU2jT4sYBnWH2T6wL1t8fs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.004632, 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 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)