From patchwork Mon Jan 22 19:41:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13526133 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 93D8BC47DAF for ; Mon, 22 Jan 2024 19:42:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1563A6B0098; Mon, 22 Jan 2024 14:42:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 107F46B009A; Mon, 22 Jan 2024 14:42:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE9186B009B; Mon, 22 Jan 2024 14:42:23 -0500 (EST) 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 DA3AD6B0098 for ; Mon, 22 Jan 2024 14:42:23 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5F8351A0698 for ; Mon, 22 Jan 2024 19:42:23 +0000 (UTC) X-FDA: 81707968566.30.9C60817 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf11.hostedemail.com (Postfix) with ESMTP id 8E5CE40006 for ; Mon, 22 Jan 2024 19:42:21 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="dgWT/Dnt"; spf=pass (imf11.hostedemail.com: domain of david@redhat.com designates 170.10.129.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=1705952541; 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=vFTvJ98fhkS9/MTVBvrs88F9yaB/zvK8UHNYcTujcyU=; b=upL0sVzR9ZILoKd+Qj7hTt/dfrtk9iDuViIWA6Gq2BF0YP3BCpELDEGu8CIQ0y8nrDJ9// MCFwRc4KMz2TFcrqqhn9aDk5zasl6xVsh0hBJTdsFIXASJfMiD3rflCIumsgaLcACFsapb Qjww/Iws9sN7YyoC6XwLXaMgT9yQ5fA= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="dgWT/Dnt"; spf=pass (imf11.hostedemail.com: domain of david@redhat.com designates 170.10.129.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=1705952541; a=rsa-sha256; cv=none; b=V3CbxENFNM4UsfbK5fS3UKHyN81g+YBFnnxmXIEikzgvrh1n9R4cAg11IsxcOo5KyLlaA0 E6wxiU71XOy+m6o8k61q9GcA2dBNiP1bIoF6YaOtvnpcPX7k+YrkoWLUyhLeYh9x3dgQQl KAUSjsP93K7mGe797M2+GYHsmDI8+qo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705952540; 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=vFTvJ98fhkS9/MTVBvrs88F9yaB/zvK8UHNYcTujcyU=; b=dgWT/DntW2iOcDXreeUYMJ5dQ+wcg76413atckZl5NERbxOdIxGBkcet+fovEqh8jDcrK1 uCRisibyWdEh7k/3lWYq70gOsFD+2T7Fb3/6KnPzduYUBAxnVB6V6azYIOqqkW0ylbOB4M UcNz3C4/LLA09rA6+KK3fL2wpj8LWx8= 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-167-RMuEdrELNYKNm7WJWua3og-1; Mon, 22 Jan 2024 14:42:17 -0500 X-MC-Unique: RMuEdrELNYKNm7WJWua3og-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 6EBB6185A782; Mon, 22 Jan 2024 19:42:15 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.39.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AAFB3C2E; Mon, 22 Jan 2024 19:42:09 +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 v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64 Date: Mon, 22 Jan 2024 20:41:50 +0100 Message-ID: <20240122194200.381241-2-david@redhat.com> In-Reply-To: <20240122194200.381241-1-david@redhat.com> References: <20240122194200.381241-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Rspamd-Queue-Id: 8E5CE40006 X-Rspam-User: X-Stat-Signature: xrm6aoackd3t94wjhbze6xrhjtgub5tr X-Rspamd-Server: rspam01 X-HE-Tag: 1705952541-327003 X-HE-Meta: U2FsdGVkX18MiLE8J87cSzjBaeqJiOjUkPC1Rkzv1n2RgE+y5SosSjiSWL4+6iqorxVqfPXaImLvOVn7OGCHdhQo8gM9IEDHe4BXylfZFBmkn6AUORqkSo9cFds1z7KbM3IENIpWwMdZW0eu1FcIXQVmII0L1JnekNGtmF19nqhYF1n6tc1q1tdfcoBiTSKOBX69Av/blws+QFQQKohfEE/gcauSJxG/uTEM+oCQ+nrfx/UeughU0RcQMZJ1PUuvAvv/pMAN4n8BMYkkBD4jrTCyGST4PIF/6Bgh47WOoxRXNwDlmHYwz8TXcBF6nA/xnBXLlr/iW+112V/zBKszN4OXwXQj7XNq53I9+IWs1JGBhY6xjlyaWWQSmPm97ZmkrKsBu06/6Lb/NqqTN7oX0EejnGhcjq1lAecs+z5uypxY+YnD5m61kMv93t25hCYB9m98wYWTd8JW26k0xXnB0vWZaSDx3dOCzvfuEt/qytdeIsyEzwSDot7bbTWbfhraEamwwr5na0Ro8wXlWAaL0+CyYjSRKxvTiBSXdUAIWK7rHtZbCzdWXsLrhuW517G8ZBCl5+eeFMhYx5B4mDAvGG7Dc+Ifyno4BesHEglN/C/z8PqZE9+pawol4cOt8UOlE08hD0KAoyd2UwMeXYomfXqboBWXGwLzRyjDkZjCSOpWdAli9baYPz+iQw++MiLS9yyv/eft+gRJoKWfiUHgn7DL40oSs9aLR5NxCIAUhynRMukn2Yt1+WnfgrIirmm/wBIy+q0KX2AstPmh/4vmuEAGj8cZ/l+zYGIrzWGO2cv+okYzj2SJmKI0ip6vrJhjKDCUTNd1IOamrTgvoVkpUpEDdyT7Zpcudmgx4eG7G46trX/EYCfcwoU49g93Vb8QSQsQbP7iQUgm1XFkjVgkf9g9SxceLOx5SINPD91l4VXk0EMRb/Ny99rPhgpVfgh9PJO20/02qAm/aCejROw 6SJq4Jrb gHRNB8YYAJ9ra1RKhmiCQb2rVjMRkI6AasP55JBkxvzLxyXBG1B4gpI7QbOv89zcKxhTeiSPvfP6798xej0dQ3Z0lv2cV/pXyN8lSfemVKamR7yadX90gp550GAMjSLR+lfFKD76B2naDz3MhxV0JzTHhGqbYULjl6weMDjt85hdlNiC/8+nWaospsKFQdVxAM6S9LtIwhfFYOEiFjEs1PGLXduxL/CZ65YsS 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 simpliy define PFN_PTE_SHIFT, required by pte_next_pfn(). Signed-off-by: David Hildenbrand --- arch/arm/include/asm/pgtable.h | 2 ++ arch/arm64/include/asm/pgtable.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index d657b84b6bf70..be91e376df79e 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h @@ -209,6 +209,8 @@ static inline void __sync_icache_dcache(pte_t pteval) extern void __sync_icache_dcache(pte_t pteval); #endif +#define PFN_PTE_SHIFT PAGE_SHIFT + void set_ptes(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval, unsigned int nr); #define set_ptes set_ptes diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 79ce70fbb751c..d4b3bd96e3304 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -341,6 +341,8 @@ static inline void __sync_cache_and_tags(pte_t pte, unsigned int nr_pages) mte_sync_tags(pte, nr_pages); } +#define PFN_PTE_SHIFT PAGE_SHIFT + static inline void set_ptes(struct mm_struct *mm, unsigned long __always_unused addr, pte_t *ptep, pte_t pte, unsigned int nr)