From patchwork Thu Jan 25 19:32:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13531546 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 A0C5BC47422 for ; Thu, 25 Jan 2024 19:33:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 303B528000B; Thu, 25 Jan 2024 14:33:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B451280004; Thu, 25 Jan 2024 14:33:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1548928000B; Thu, 25 Jan 2024 14:33:14 -0500 (EST) 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 0191A280004 for ; Thu, 25 Jan 2024 14:33:13 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CD56F140B98 for ; Thu, 25 Jan 2024 19:33:13 +0000 (UTC) X-FDA: 81718831866.21.8D84B52 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 05A90C0017 for ; Thu, 25 Jan 2024 19:33:11 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NojYa8rs; spf=pass (imf10.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706211192; 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=JLkdB3aR8b5AzZf8mrQLfb2UlnHWewFM+noupjKQsYY=; b=A6KqBDBWQD4u+cnfalkV0uspbGI1fetq5plapbalVM2+ldoTWtq6nV5i0SrvvBO1NtYhzX RKLZquPwAh0k3nnlTnxXeybqLsxPy5rd8cL7QgyJOWEeij2QF3WEPUk6me/2gLeTZgg5Nk xufQLGw9QKunlerjW/0q4jwz7WvHlw0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706211192; a=rsa-sha256; cv=none; b=3iTsxfroPszPay1aJloj3uWK88dIo8RNskoHx6ygIleHMi7FaWXz+PRLsvP4AZp3Qm3gSl SFA8ztcoTEQO1mOnpxzNuveBRD4TbG3xhxsme4abKiHBEtTHKSeV4SG09yaH5lvKd5Mudq jN6QEOCN4s/SwGbCnRKUoE7wpalQm+E= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NojYa8rs; spf=pass (imf10.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706211191; 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=JLkdB3aR8b5AzZf8mrQLfb2UlnHWewFM+noupjKQsYY=; b=NojYa8rsnlGQpAElfyYOesIjD5LETWGFcNKsiEpQUCyBzlkNEhTJsHVooaEw9ssbekUV5C nKj5qPmaEhenzPm5vXRLouSXwt5k8CEiJ+vzKkkc90iI3DdcwGxlKPgfuGCldfdrIgPtTw B+8iqA+xu/b220WkynRoazHYLoQxLcU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-140-gRvtxHOMNz2NEaPqxmRHPw-1; Thu, 25 Jan 2024 14:33:06 -0500 X-MC-Unique: gRvtxHOMNz2NEaPqxmRHPw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 045F81013673; Thu, 25 Jan 2024 19:33:04 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.193.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59F4E492BC6; Thu, 25 Jan 2024 19:32:58 +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 v2 05/15] riscv/pgtable: define PFN_PTE_SHIFT Date: Thu, 25 Jan 2024 20:32:17 +0100 Message-ID: <20240125193227.444072-6-david@redhat.com> In-Reply-To: <20240125193227.444072-1-david@redhat.com> References: <20240125193227.444072-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Stat-Signature: 8316kkwojsww4rq686138c9d44oz46kz X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 05A90C0017 X-Rspam-User: X-HE-Tag: 1706211191-323848 X-HE-Meta: U2FsdGVkX19QVRACp9wyIbLQfiQE5sKMZP8Dv2je9ohvp6FqxOZVCTU+qW7/Xh7n2mq3gBrTepUWHApRiN6+5VPeHLOEqQnWvJabZYEaXcFB464Kezd6sZBTMluOZ05QTxGosPyRFp75xGxD/c8nP95rTFYT6NA4EWNpwdi1YtzZNIhhzCk5wRXuRB8aTZdJW8iW507x7rBknTybFCIkPAe8v3HNRuTG/CDVMD9eAVvf4uHX7/IED0s3DpW2ZqFCJl5ms9ZOhsSn76xXXmJNFVXThkuWRfi8Sywij+Z+fEsu4Q9k2o7MsWpTMNx1Wn7Kc9ZeubUWUHLuzLVoJA5J50QVujgV+kcc0jL8Cq7xMUGEY7hXzYPf811sqEXKiRcP5uyl7RIuix7Id8Tfq4Ev6Qdm+TRz2LX0jCOfkabb51kQyTodtP38UwTza43H/ax9SnuG2nqjzwIyPM2Z70cHyxcULIGOO08MOD0bMVt81BAlydLFuPXqtnRJ8YT9006Zq3dcHuv2ETYwqn9m/VaoO3oneuJ/V4g7ZdPoxq3r4iLtQZ/8CjL5jc62vJGBbOIKCXgvgMBj0F+YmoizH+FWeTaEy0WTNpcrAapC9k7sQ0lssDLLrjdA5jiJ7Rs1lWDHEfCeRsak8UydzSCS6SvcAWC1/NPi0ATkgUip5odhSiVwAUxAFAy8QEgfBHuw9d0hqC9xSxbIRccm+lkmOJbEL6u9xONiGRUEjlxr0rpXolPXZYRuzyiA5pcg8pw5YG+HskjOb6psuH6rroLaazqfXi5UNsdopltuuR+Lyh2op+yCHlHdWTkKfv9AcpdQwljv2QH82uneSRfjT7lEytN8NKCRqvhGlzLNzrtPuSftvpeHLDC7wjeQuA7RNXQRYHcfS6PRB71SFKJpoZq2Gpvhgm274nItCMRNTiK2BrdOFrZAan6S0+xbcCEiW8NhKq7Ie383NjIWWxQB/IURVDm ea74/SPw NIW8POtuLFMo9Vep5Z3Gt0pQLBdHRgUR8ZUR6GwD6GIufrzt79DZXgtn0KNhfEuQUEflYsqbvlRduiaz1iOSBCU7r50QIIb5RQ19WZTayyHHdHlJ3+fyRr3fFXsdhqhKg9wTk6ZiCWMRSK8+3zZLG5yrCp7EtIQmowiF9BgNhEJpNsEnwEK4JlmnED1xBElfeL+MpJGKRXcEZgz/ZKAPld3ywjVUM411wrYX9kgjZZj35k+YkzEOm0dhe6rHg2Pa+5lVMdBzT/Z0lDussPzjRnhit7w== 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 --- 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 0c94260b5d0c1..add5cd30ab34d 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) {