From patchwork Thu Jan 25 19:32:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13531549 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 6FE2FC47258 for ; Thu, 25 Jan 2024 19:33:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F38E228000D; Thu, 25 Jan 2024 14:33:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EEA84280004; Thu, 25 Jan 2024 14:33:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D637C28000D; Thu, 25 Jan 2024 14:33:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C429F280004 for ; Thu, 25 Jan 2024 14:33:32 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 67891A0585 for ; Thu, 25 Jan 2024 19:33:32 +0000 (UTC) X-FDA: 81718832664.27.6232204 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf25.hostedemail.com (Postfix) with ESMTP id D7BE1A000C for ; Thu, 25 Jan 2024 19:33:30 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ACiCevU1; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf25.hostedemail.com: domain of david@redhat.com designates 170.10.133.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=1706211210; 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=+md2pmrHp48BftcWE7oPMr3+y6qzWNOJ1IOyjx24C4k=; b=L6L+V4slys3Tp+Qn1IwPkGOWqadjTugSqA/O1DGlnbr7TCDJPcXQJ0I94zs2m2iJjTWwKh 2WNVB3V2FbLfTxFXguC7MEmIt0Sb+wvetT1GYZbTomwrhtWKy0FFoEeqWG7a5KrCIw2ors Q9iL1xQuAMkJHEYxvM8CB02fcIrBXJs= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ACiCevU1; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf25.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706211210; a=rsa-sha256; cv=none; b=zLc/8F+d5yxVNm+69NuMf4AqF7Oth2VTE+gMFbajBSMyvjYRhSGn8uiKkktA1MAT+posI2 93w9Gv7AqAhZms8izTsjpKaaGtR0fTIpM5Ftc+18MNQJzG5eC+PtsIal2ibCxfid4ej+B5 rmLL7tALB4KBx/yeeK9bC8gqiAbyEDY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706211210; 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=+md2pmrHp48BftcWE7oPMr3+y6qzWNOJ1IOyjx24C4k=; b=ACiCevU10qLLFCYhxz3v6IfzhOBp2SJgoOAS/ilBzcNxvvGtR9ApJwyufffr+oasMykA+m /1eCgxZEZnRZDyQuH0VX/6aEcWJTtv4QcS0NFtmAD7gmSxjAfSwUgLw5pE3ALaGbnVpw+S ONecy4tpuxa3xiEO4dXd0lU9At9McMs= 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-52-07MQqOk2OR24s5b8tCmCuA-1; Thu, 25 Jan 2024 14:33:24 -0500 X-MC-Unique: 07MQqOk2OR24s5b8tCmCuA-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 658038432A2; Thu, 25 Jan 2024 19:33:22 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.193.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4DC1492BC6; Thu, 25 Jan 2024 19:33:15 +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 Subject: [PATCH v2 08/15] mm/pgtable: make pte_next_pfn() independent of set_ptes() Date: Thu, 25 Jan 2024 20:32:20 +0100 Message-ID: <20240125193227.444072-9-david@redhat.com> In-Reply-To: <20240125193227.444072-1-david@redhat.com> References: <20240125193227.444072-1-david@redhat.com> MIME-Version: 1.0 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qINu2Os4JqntrLfsjDEk9CBNsUQlNbqgzhDRZftb 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: Let's provide pte_next_pfn(), independently of set_ptes(). This allows for using the generic pte_next_pfn() version in some arch-specific set_ptes() implementations, and prepares for reusing pte_next_pfn() in other context. Signed-off-by: David Hildenbrand Reviewed-by: Christophe Leroy --- include/linux/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index f6d0e3513948a..351cd9dc7194f 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -212,7 +212,6 @@ static inline int pmd_dirty(pmd_t pmd) #define arch_flush_lazy_mmu_mode() do {} while (0) #endif -#ifndef set_ptes #ifndef pte_next_pfn static inline pte_t pte_next_pfn(pte_t pte) @@ -221,6 +220,7 @@ static inline pte_t pte_next_pfn(pte_t pte) } #endif +#ifndef set_ptes /** * set_ptes - Map consecutive pages to a contiguous range of addresses. * @mm: Address space to map the pages into.