From patchwork Mon Jan 29 12:46:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13535519 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 C8157C47DA9 for ; Mon, 29 Jan 2024 12:47:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 597206B009A; Mon, 29 Jan 2024 07:47:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 544F56B009B; Mon, 29 Jan 2024 07:47:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 413216B009C; Mon, 29 Jan 2024 07:47:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2C5906B009A for ; Mon, 29 Jan 2024 07:47:33 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0E131409C8 for ; Mon, 29 Jan 2024 12:47:33 +0000 (UTC) X-FDA: 81732324786.06.9F8DA13 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 4492DC0015 for ; Mon, 29 Jan 2024 12:47:31 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZKpuNvsc; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf22.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706532451; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TR23YVq6t+vxDxzPS6q2xEOscQxVIS4+3klgCmYFiGs=; b=qTJ7WA82/IrPtwskHmZsfWpLZZ672z1Ea/+3Knbx7HQlNjW8XwQnsVR347r6q3dMremFvn 0i6yUmtlCIM1FG+5QY2SB08Lpzj74n+S7SygYz+bzMHn5P+rAx7KAvJgx6UAjYRm8yI/ys QlAeLowti9tn8tyBzzV5KyB1VPTKB/A= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZKpuNvsc; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf22.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706532451; a=rsa-sha256; cv=none; b=waAOO3ilMEW+pNCMY9b7/LSqkoGhnmYGcja+VGrnBwBXSr/FWE9256QNbUCPVXUlEOXHE5 Shk+oB1k1FFaiTkEq7hwig8kG3lu2z8gxF82XG7h817VDa/O9+Mlfr7PQjoHUhcGu4ZWQU 6LSgr1hEqPtb9mqbGB7c+73otWzA7JI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706532450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TR23YVq6t+vxDxzPS6q2xEOscQxVIS4+3klgCmYFiGs=; b=ZKpuNvscCmsVgMzIojyBiOb+7GwvB14O3cScK0bVz+xJgi4OeahsAqazWHCPX6+Wp9Szxo uZ8VIe/9B+H8Ou0pp9oqrQX9c7Xzj9Www7iBnT0OnyHfSAhMAefojU/8kLO1uRC6xNPmw8 LLQ8RpkA0LZBK/l15jYmMxBEcZNZNXQ= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-317-aMm9C5FkN5Gfoo5yJn1Edw-1; Mon, 29 Jan 2024 07:47:28 -0500 X-MC-Unique: aMm9C5FkN5Gfoo5yJn1Edw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CB8C329AC02A; Mon, 29 Jan 2024 12:47:26 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.194.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D62B107BD; Mon, 29 Jan 2024 12:47:21 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Matthew Wilcox , Ryan Roberts , Russell King , Catalin Marinas , Will Deacon , Dinh Nguyen , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , "David S. Miller" , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, Alexandre Ghiti Subject: [PATCH v3 05/15] riscv/pgtable: define PFN_PTE_SHIFT Date: Mon, 29 Jan 2024 13:46:39 +0100 Message-ID: <20240129124649.189745-6-david@redhat.com> In-Reply-To: <20240129124649.189745-1-david@redhat.com> References: <20240129124649.189745-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Rspamd-Queue-Id: 4492DC0015 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: iziogiux4ypg7apx8d7ajhw1jw5xkw6g X-HE-Tag: 1706532451-919643 X-HE-Meta: U2FsdGVkX1+LJvFn128Q9FHjal38J1Pc8lVvw0I+NF+O7kPjuvz/fS9jYDE4Zgbu1hcPM+6kew/kzvLn8PzNo0eFQKncltQxeUamMsZDAjr1+r/DqHXZ25YFxpgKHD1HNZlqDkJj07eM+4NgHLQWn/3sg3krPmau9FjpSyi3mMSVEWeMY3XX8dbk2LJMFcRTZ1FrEjydb/Ej/+ECSbL9r89DAnIccWqsNEULaRauAOoPjJvJNI7nHt/r7q28FvymOUTG387xM/nw6HLlbDKY6TlxAAfrDhj6sqjjiX2OUH8q7aa041JXfpHXk+CJ46ToI1L1+6dkppD2xj92ZhEFQyQjWrOAxdMV2hyZO6qkAlR7uPAKbGB7W0UU9s2WnmeADH1TBdpOTuwRM0kqDKFbhajNBGC2F8aT8GTK6eLngopCTg48lttrrtwydkAcVamVeUcF88ALFhpT7MmnqbEV/Gh3oajHfWr5QpYVr/reSdRJfO7ftYA7wY+1WlVwHOUfZY49Z9gBQqX2c9gHQwSIUsFCdw/w2UtBVxJeFA0Tfgar8erYxyYRVVKtTaSUN2VTONlJkq0HKkHrzjdce6JpUkkNtqFTw1o4FzL80wQGnkI7JELRUJZUQrjws19+GChnsO7dL+RqvHc3pfq4z+RjWVKIMg2SSYkGWjIYUEAk7T1lHwWcCBmVWDS7G4lxLwHqk1u+rPBjLXbD8bWcaUD10/ECGZ5ulm1Vg1JG852tsDHQY95XdGZVsmNFbdyP/ItBIkHoNi2Fxwf7ToEBJW82zpilyNqoNy33B/TzHMAjxuY/Vbro3fZyAEqkI9KwZZs2xBsep23K/kxD/QNh3T518fZRcFbsY7e6VHzHyNNkOyKzSncck08sKZ4qClq4JnRj9WhEVON4OGLZAYRGRLY9+LaVuGDFYhmOJ+Wz8ddJ5SdRGuQlUr14eAdt3uga+TJGH7IU4eHHPU3dNGB0QsT IeAABsOx 9WP5nbWmrH4V9uzmcnqhxfSbgo45DwqRPsrSftT+VYf+2LhwJAJNHqQcAd6e5EypIPjroAvE3hzYfYsPD1VMRFhOefQjY6m5nMsbcVeP3azGds/TXaA+gEE8iryuZYY2MKJM2sOo3U3tQCt2mdzQbrCVbIOlhAjacX3D++0aomlU0ENE6J7TuebOyxFVNLBX9XUgUz121Bu6MaPTbJCKtsbJj6Gbvf6YT1+gfrFGfTSJNHOcGHMBG/n1fhzGTl6SkVuVReiecuNmU9gw2Tg/TSdMAvg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: We want to make use of pte_next_pfn() outside of set_ptes(). Let's simply define PFN_PTE_SHIFT, required by pte_next_pfn(). Reviewed-by: Alexandre Ghiti Signed-off-by: David Hildenbrand Reviewed-by: Mike Rapoport (IBM) --- arch/riscv/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 0c94260b5d0c..add5cd30ab34 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -523,6 +523,8 @@ static inline void __set_pte_at(pte_t *ptep, pte_t pteval) set_pte(ptep, pteval); } +#define PFN_PTE_SHIFT _PAGE_PFN_SHIFT + static inline void set_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval, unsigned int nr) {