From patchwork Mon Jan 29 12:46:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13535522 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 813E1C47DA9 for ; Mon, 29 Jan 2024 12:47:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 12C9A6B00A0; Mon, 29 Jan 2024 07:47:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DCDF6B00A1; Mon, 29 Jan 2024 07:47:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E95896B00A2; Mon, 29 Jan 2024 07:47:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D6A8C6B00A0 for ; Mon, 29 Jan 2024 07:47:51 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id AEF9CA1E5F for ; Mon, 29 Jan 2024 12:47:51 +0000 (UTC) X-FDA: 81732325542.22.26CCB02 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf23.hostedemail.com (Postfix) with ESMTP id 073B9140019 for ; Mon, 29 Jan 2024 12:47:49 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Wfr0+qJp; spf=pass (imf23.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706532470; a=rsa-sha256; cv=none; b=zxS5ShAFWXwtdhuCMQx/FTqTJT+g45O6VaQ9fEtHWefhr4uVHcDvTarymj4hNn0O8SFvfK 1VZyBgmeV6Je3Mc50SAnLoPaO8wfLpPvU4E7QGfmlytvbg2YCsHfKFc+IeqanNnOr3Vzd0 vsXAFARYoZzAxfVKy2ROWMIr4EfxUkk= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Wfr0+qJp; spf=pass (imf23.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=1706532470; 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=dXK02yTQR3iX9+2hOAsyvxeT8orGle3067Vuz1QJ0iE=; b=Db6WqCBZqUVXjHDNLK9D0KOPk/v6dZrJv4ds6nFJfK3MKbHvvPTPN1JGPH/mVCpXCQNAsR ypHWakfcOM6OQJ7GPQ1okVqSIXNqec7zpwfNLF+g7C4y1f1mI91izGfTBO7u8h8hk7B8k8 mreVCVfejH5eQ6YbaymorfefUOLhbf0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706532469; 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=dXK02yTQR3iX9+2hOAsyvxeT8orGle3067Vuz1QJ0iE=; b=Wfr0+qJpqRUdmSELBjWCJKOwk4YE3A7vrIhjFoSZjFWhFN1AaFXDGfoFFS0ZAqGyUpfiXj bd754oEVg9YCgGmjORs26Vjh8Zljv5CA3THlXoSn4yvTpOWnW0AgyPqTxVUOsfKj7OGKBr Tkffi8EtKir3aKebCoQlcaw6fBeFynE= 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-512-Yd-jPcF4M0WLV77ep4J5DA-1; Mon, 29 Jan 2024 07:47:46 -0500 X-MC-Unique: Yd-jPcF4M0WLV77ep4J5DA-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 C956E3CBD507; Mon, 29 Jan 2024 12:47:44 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.194.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58D62111E8; Mon, 29 Jan 2024 12:47:39 +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 v3 08/15] mm/pgtable: make pte_next_pfn() independent of set_ptes() Date: Mon, 29 Jan 2024 13:46:42 +0100 Message-ID: <20240129124649.189745-9-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-Server: rspam08 X-Rspamd-Queue-Id: 073B9140019 X-Stat-Signature: p5sr1do3p1tmke6xg5a4pnq8ykaygchd X-Rspam-User: X-HE-Tag: 1706532469-227408 X-HE-Meta: U2FsdGVkX1/pOw8BJ/wJId39vTHmt6Q1rCeB7/OwcNkJEuuH4sKTSUHVNCfxfDHDNvlL95HZ9qCqtIHK+2gGBqC1bKNd3ULHCRMuchLC+mA3eMrAOLEfJfT/PmjcT0cQOhdT+92dOJW0oORn3gbX4+pb56lSpq2g7DDWhytu+Zk7TXPPVjKTVmGNewcXcKvz6y3hgrvqAvCkNqNq2MmOMiu3hZX2m0gZcWZ24sElBQddU0cNhIq0Vb16evHkJevttVSjBW5PM3QLA93A6/qM+PDCrkpy9VH0cvKHWx7nKAN1pEk0ImcJh6mYgdVW6t7u5PUHCrOlkN0CubxeT7pBKQ1vx39hJDPZD+eceMDePyKiGgc9VI0BhAiUVLNjNJMD2edB51JUI/FvEBRIoYaPQFxrXFEkpSXuaCQHSlFwAC8tOyXpFsz2AR+k8pEqqEnH/i24z0Bj0YwneWmzbgwc4HLM2syp63mLvI//EIvLlqYRCHHjPj/RdyKlAQfxWBKktkiE+yUOspFFz4SHGLTuDE0C18Vjl7LL8CzFUDM1mNqBQT2N7q1nBn7Ld/XQKksZBO/CWddK5UEbPmk5Uaqfx91FzrGuuF1y9clljOABYr191LgtjinAwaJMhaRAb2wVIzNRm/0x57jKXB9wdW8WbChm2/A4xwH7RYmY+JsTTmoxiCC5ipvxQTlM89CE5UHbhomZ0zELoMLeupin9OSw70RO+U79xbaD3OhznRtXhn9Y7/9Q0pr3FHw2LX9UE7z+CT3l002KwZyIiQ8Iwuxpiiwx4ubRV8sdDu9dkMdhDa8zSPMsd/NNB7l9mKRPMgvawO3kB8ZSu880JP9dYPHZtvsRGKFYNXeBuxpXr6JZzKV6cs64rUw4pulm54sAsLy71np+8Z5UQvNooggwOirsJLFVU5ekDT+WCOGFq9oHJvHpJC1cqgwHfcNVJxx7tqs/7SY3ZzL1B3LCy/Cb744 la+Igyh1 G36W0WKtI2/QFb/TeawQujkljA71sezK8tPOvYqYknEOfX90PV/rWHFl4dwBA9YSC9FwnIAIBOpHOTbwzaMop/EPCoLrCq5VN/GhYi721WuLbvNDeBqmjOW0I/6NvDpagDbQdLI3gwizcu7qDyqnrTepdaBtDOdLRaQk+yNykHe2IrnkMafYtammWF6LYsHBUJ1FpcC3WVNrYXFR+ZWuq0HwftDf4U6xxJEng0tueGRpTuniLtBsd+VN78sR32E4tuVh5MzMXiVdU1tNUd14WvssOvA== 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. Reviewed-by: Christophe Leroy Signed-off-by: David Hildenbrand Reviewed-by: Mike Rapoport (IBM) --- 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 f6d0e3513948..351cd9dc7194 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.