From patchwork Fri Feb 2 08:07:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13542342 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 43B41C4828E for ; Fri, 2 Feb 2024 08:08:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CF7246B0088; Fri, 2 Feb 2024 03:08:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C9E406B0089; Fri, 2 Feb 2024 03:08:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B66596B008A; Fri, 2 Feb 2024 03:08:45 -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 A792B6B0088 for ; Fri, 2 Feb 2024 03:08:45 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7A27A1A0124 for ; Fri, 2 Feb 2024 08:08:45 +0000 (UTC) X-FDA: 81746137410.27.3BC8170 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf13.hostedemail.com (Postfix) with ESMTP id DD06520003 for ; Fri, 2 Feb 2024 08:08:43 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706861324; 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; bh=YPFZqAqLzx2QQ/vmuvlz3bcsLX4NUf8WSSH2bWwChpY=; b=yc557A4QWD2iliU4gu24p/QAJkL1J/FvpsxqmR12CIX5qtrIsRrHwGnZ5lNsgUovHFzVXO u6WGtELaHIgmJWBqT7WdGaJvi/9Q2pi1zaJR5d/wc8iGQ+oE2FN315kxvfRYrAZoIyoGDM 1CbWE3334Cn+7F79OudwTbZYYt+vogE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706861324; a=rsa-sha256; cv=none; b=bfCrQEnWZ2qxcESg2IsfhBuYUy88cmKG2w07FW9ZOOfQwkcW1QEWbW399ll9mmusqQkFJP eZWSlisbZwcTPGoVGXncREZ2FxcpxVjleYUM08z885njSWDDJtR4Zv1N8RpiZhlV9YxhDy Wx96iw+JM3oY2lqGRY2dlZKZgp+VxG8= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6299E176B; Fri, 2 Feb 2024 00:09:25 -0800 (PST) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 76D9A3F5A1; Fri, 2 Feb 2024 00:08:39 -0800 (PST) From: Ryan Roberts To: Catalin Marinas , Will Deacon , Ard Biesheuvel , Marc Zyngier , James Morse , Andrey Ryabinin , Andrew Morton , Matthew Wilcox , Mark Rutland , David Hildenbrand , Kefeng Wang , John Hubbard , Zi Yan , Barry Song <21cnbao@gmail.com>, Alistair Popple , Yang Shi , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Cc: Ryan Roberts , linux-arm-kernel@lists.infradead.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 07/25] x86/mm: Convert pte_next_pfn() to pte_advance_pfn() Date: Fri, 2 Feb 2024 08:07:38 +0000 Message-Id: <20240202080756.1453939-8-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240202080756.1453939-1-ryan.roberts@arm.com> References: <20240202080756.1453939-1-ryan.roberts@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: DD06520003 X-Rspam-User: X-Stat-Signature: 1ia4afaotwu95frdjz1msej6c4hyrknp X-Rspamd-Server: rspam03 X-HE-Tag: 1706861323-201774 X-HE-Meta: U2FsdGVkX18s+N8RbTr9zcJ3ilhxJaAHQDApdr09qGYMywvm5toYx3Y2sQA0I9glla+w3ENS2c0caYzbOZvK9i1rSn6KEQ7lVE/9JHui/0DYhWqOoZwpzoqE+sbegO+si2/wZVQx00iD9EAtRLCtMh+TjTGRSf3Mwt6j/0cSEs6ZN/YR4Ke34jOKlNJgOvHP2Y3+ougJ/9aQP+cHWlJfhthewro1t7xwr5J9z9NmvqrDA3VewnHhDkZvu8g0r2WxrkwTjuNZqG+3dQcjbhoG3UPB1lQk89ix4BekU60Kk1eREeCsUp0uAL/kYb/bInhZcI1tgvvzmaha5W7FVmWTTkNQPjxJgXdTdy+7G4eySUrsm0Su0TUQP21wrXkJmghQOtPb4t4w+ta6zZZCexkYm6BRZgfWXDdCQk/2um+cSE+4P9mORIpud8rLyeD5Pue7hc1Gh8BmwcJPb1Z0HYw4WHpLRoIAtAKbJkApWpC9DhMxbQgoGcIKQKncwIjVjeMHPytSYcRHPHfw7nf3EeB3hipuGrlVERu3Sz6spxqzLZHaOuQYPWv/P5Ov2udikS9wQKLAy3btmaatblcqlfE+ea1o0FLTyrM6XdcZs3hYlNSMWbJqHv28EB5qR8/5GMvXxYxergn2QcZ/NCRVrnwlSnVHCROsEuR0sU6X03P2AdcJ+VGoq4FUTXJOIxd8SN0BDGl5PkS4G8+9UqZ7/zG+X0FxgDfLj2P3OBRDu4HGTYc+B2ZjoAd7/UNKGHijMe8pM6eDqAR8+gUyMixtBfJXCygcPyf6TwBtNtssolfvbKQirZuCaCIVJVI8YooGpZuV18KFARwtWMpJiB9ObsXsOOeiJF6p2sYqdlSzhtW3Cj4PhPe0ixhr6kqFWOva4jkMHN8uvKYHJLNM3FR2Rl8eWny0TrKw5hTJrkihgFcjVpsF+MZMrimSpQroLmjPJ+osumhL8ypNG5r6VTQ2eoI ypmCMuwv RI+gjcHzOYDV2t7wrw2B4vopU0NfdvQRzxr9iiE15UW7vyZfHNE275a4f/kAAbTzg4jdRjmZ1srfi8vbCnc00AlSbE/TUTgc1MJrgDoHFWc6JbhBizcxzkqOBMRoMYO1aIudqBcFeaGQW+thuxLKNlZo9+nZ8wVQdSiCWdZ3+4bs7EOZLIJtfmtRSWaIU9ChrKDCEV7WhsvwuCOlRW6KF2quegswfyBj/XhCiHRqSll1ZhjKU77NYzXW6Obux3FslvVmxe5nsk6psL8ifHehSVQvukA== 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: Core-mm needs to be able to advance the pfn by an arbitrary amount, so improve the API to do so and change the name. Signed-off-by: Ryan Roberts --- arch/x86/include/asm/pgtable.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 9d077bca6a10..b60b0c897b4c 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -956,13 +956,13 @@ static inline int pte_same(pte_t a, pte_t b) return a.pte == b.pte; } -static inline pte_t pte_next_pfn(pte_t pte) +static inline pte_t pte_advance_pfn(pte_t pte, unsigned long nr) { if (__pte_needs_invert(pte_val(pte))) - return __pte(pte_val(pte) - (1UL << PFN_PTE_SHIFT)); - return __pte(pte_val(pte) + (1UL << PFN_PTE_SHIFT)); + return __pte(pte_val(pte) - (nr << PFN_PTE_SHIFT)); + return __pte(pte_val(pte) + (nr << PFN_PTE_SHIFT)); } -#define pte_next_pfn pte_next_pfn +#define pte_advance_pfn pte_advance_pfn static inline int pte_present(pte_t a) {