From patchwork Thu Jul 27 21:26:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Charlie Jenkins X-Patchwork-Id: 13330783 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 2E34EC00528 for ; Thu, 27 Jul 2023 21:27:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB9F66B007B; Thu, 27 Jul 2023 17:26:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B6B056B007E; Thu, 27 Jul 2023 17:26:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A31C26B0080; Thu, 27 Jul 2023 17:26:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8C5AA6B007B for ; Thu, 27 Jul 2023 17:26:58 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6AF10B255F for ; Thu, 27 Jul 2023 21:26:58 +0000 (UTC) X-FDA: 81058676916.13.383CC73 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by imf08.hostedemail.com (Postfix) with ESMTP id 6625D160017 for ; Thu, 27 Jul 2023 21:26:56 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=HH7TEI0F; spf=pass (imf08.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.210.178 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=1690493216; 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=nxIryN+/nGnN7q5/mJrC1dQ+rinWckKL0IS2jYwlkeI=; b=N3E+LYjCWYBrWMnf0bWMlm7JsUVtMg1yc0le+kmQQSmYKdDOXiSbe/YAXANa21fDg+zP8x NsiwE9IjtAFm7Ld/KmphS4orgGYSh86bq5VOI4/T9zrHfUrbU/kr0vk+A+onWjM6nNB9S1 LrymDZ/++6qth8s2T2b48coP00KpBI8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690493216; a=rsa-sha256; cv=none; b=w2v7PX0frN9aGq/u35EBSR+zr8h23DJ7aq0qCfyjXNG2IiBYcnpNeHEvBVaSlbIXirjMDf siOcO6WA06uD63kwC4Jq6KVfGZs+g6Zbqr2W81GHZHumJGk97eBbXxKinxvAqAHy7asr71 d5si1zvHW8zD6jxMH3ejLLHxSRkv01Y= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=HH7TEI0F; spf=pass (imf08.hostedemail.com: domain of charlie@rivosinc.com designates 209.85.210.178 as permitted sender) smtp.mailfrom=charlie@rivosinc.com; dmarc=none Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-686efb9ee3cso1370323b3a.3 for ; Thu, 27 Jul 2023 14:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1690493215; x=1691098015; 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=nxIryN+/nGnN7q5/mJrC1dQ+rinWckKL0IS2jYwlkeI=; b=HH7TEI0FKqELKzYIXsjAzNMOv7EmEk19k49xsmg5JJ2iJpQjJBUsJBektepS7kbqjA Vt/YOabaV+5seRyrTS+nQFfXRu/Rmc0qF/Cmuzi6vbvzfQQ7hYiZSyJOGxFRzI1tA3px fkP0ufFuAla153rOmkqGNp0bHyeGAvpUM3evTA9mfbdGVkW+96ufuS/f54M74SC3GCRo WqzWIVc8ARWe8/mWjw/9xYezMnJhgSJlmpSTw5U4/6ICvlMwjc3VVGpkITduwPQnE0vT zFsh4Tq4pcASeCN6YVhHilpdFEEvWGuxwZ4SH0AQAfZfQIb9FQNxijHErK3RcGa3TLoV 6PHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690493215; x=1691098015; 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=nxIryN+/nGnN7q5/mJrC1dQ+rinWckKL0IS2jYwlkeI=; b=llbhEdcrsnLuHxfPcThjskMlAgnqxwUFKrE3hc2p5DHMBBH3/0JU6faZDAt3JZLVCv w4EjbQ1wc1zsPlnRA4BbT4BbHF3jJiC7ilqBDdnjVUaTTLkSyYmKUy9wJ68kcli3qOVM akirTIh+PSyiXeAJ6gCfiUgH3F0tulr7Ifer8yg40O0zH5SX67MOJ23/DpWmKl24xJYm C5qfP7ubcfHrGpaooHJtnmyJcJD4uGF0s1S2v6/xdlP1UP2jQcCC1dgPHgMg/tvzHBhh k2Q07sV1nPtBm++yEgqKweI328GOl8A4/akIsp/AvHSWF63/kkUU/PE3CjlUQmckmXyr mlDA== X-Gm-Message-State: ABy/qLbTsYJaTaRZkGBB+8Ly9GjXpWDCTFEAyHuaB5AjDWEWteptbNio XZVNGSE5/BUq3pkn6qjJ+JEZAA== X-Google-Smtp-Source: APBJJlH69UlfwIWPYbCOxQtQ76ua+pdw1/ixsjQRFRBQgUh0yQ7pLCSXX0UzINbZgQLjLL4GlXZWZw== X-Received: by 2002:a05:6a00:2316:b0:668:82fe:16f1 with SMTP id h22-20020a056a00231600b0066882fe16f1mr369674pfh.1.1690493215262; Thu, 27 Jul 2023 14:26:55 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id c5-20020aa78c05000000b00682562b1549sm1912312pfd.24.2023.07.27.14.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 14:26:54 -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 v8 3/4] RISC-V: mm: Update pgtable comment documentation Date: Thu, 27 Jul 2023 14:26:28 -0700 Message-ID: <20230727212647.4182407-4-charlie@rivosinc.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230727212647.4182407-1-charlie@rivosinc.com> References: <20230727212647.4182407-1-charlie@rivosinc.com> MIME-Version: 1.0 X-Stat-Signature: n5n1sfccqfjrmdrg9icxwpup7zhytruf X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 6625D160017 X-Rspam-User: X-HE-Tag: 1690493216-90355 X-HE-Meta: U2FsdGVkX1/kACq39dB3kFc2/PPAcFO3nup80fiSwpZYhTVsmi8Sw68fsiCKlIVEeeYa+e7NnaibQYqWgtrNXDZIdDubuitXv9t3vorSaCyIJTcVd0y+VM7nVo0MtwVHSV9a6wuPtR5OSfk401WpTSS0nrdfS3zsIUEUkYbLofkBp355JURcNZe47aP5y9TqRIg7+GZjQP8GWqrIKLYS9XN8RhtSTg3YiBESKr95rhjRzmEO3mzfT3psdZUBAAK3XcAkuD5PM3f3O4x+ShEEhL+pU9Y+v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Z/PBcnD0gJlkblwLr0lIWJOGxsj/twp8AQQ0gfP5VBb5R0t2sk/gA4kRQKcHjCXAV6UprM2AiJU5o= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000587, 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 c76a1ef094a4..b551467a1dd8 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -848,14 +848,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)