Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp686291rdb; Fri, 2 Feb 2024 00:12:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5EvpWJQ7rntvsbFtUb5BcuHVYhPZwLvfpioasPSBbUiQfQkBbCwtKLVXpmOBQICvuy5OY X-Received: by 2002:a05:6a00:4c93:b0:6df:e035:5549 with SMTP id eb19-20020a056a004c9300b006dfe0355549mr7925787pfb.15.1706861526273; Fri, 02 Feb 2024 00:12:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706861526; cv=pass; d=google.com; s=arc-20160816; b=qRhEeC77g8oZLClvDNkovyqOcvA7OD219LOOVcyL5fHX1Q5MBKkRkQleArHTletVcq ZnJ6yTKA6H6ptPILOBI4mWyOKETr7yWCAc+K1dfghFCvKn04hDbQ4O6Zb9Rf3Yrbs4to nfEbWg5VwaUQFVwMcSg9+MlfVpELRmaBTN0ZX3CPIeGRScztR+jVCQaGDMPHh7WSNWMi +WNZpjnhkjD5qRZ1HbqLAvMzlRh07G2TV0Sker1BCr2IgUUBn9C+wM8PwZChW7xTRx06 JJkBh+WIU9YIANeNEhby+uQEIYlvxQI7rw4L5MtyxsgMiuZoIrbj9oF2naPeFSZCBJUM rCrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=YPFZqAqLzx2QQ/vmuvlz3bcsLX4NUf8WSSH2bWwChpY=; fh=c9E1Bp8LoCL0/pv92A7xQjtUN8TQ0dQvzt7sEfDbQ8U=; b=Zr0M0YUvH8+PCtgi8uEDQKya9AmF4PdyL0yduTlC47LUsSNcpNpsUb5T8rXk4bZGGt ZQKDhiGjMcy6f649BF077fZfTKoY8AOWFPp4fVJ2NFTtUCZnNryRiNp7mjfFlhOBgAWF S5QiLnkWPMrLQeos2V4OG68NbdOC/1EjB9qckEHRLQrD17tz//i18di+CMeSxJftlns9 TfnHNVEF+aWDbWL3s8g0tgfbtYnvDo9gW2W/O8rL4KvVmYAibfSdTQiVk33+4CsOf8yE P7sQVrdFEVXMHWQ2pfab7UbDGZj8x/eDMaLQBTZjmfsEyG+5jCFBls/7fAKsh75OkbUw YEzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-49419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49419-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=1; AJvYcCUBB7tjm+AfftfQgjdWMTdD3swvr+ZaSFfMZOZrdx/pBtreQUIEr/Swf58TGyBNG7v3d8kiJ1dU/9X0MgHwurfgyE5qxzuCl7TcQk1Ztg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f9-20020aa782c9000000b006dff4dd0eb8si1122193pfn.79.2024.02.02.00.12.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 00:12:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-49419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49419-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E3C812910B4 for ; Fri, 2 Feb 2024 08:10:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA1B33FE5B; Fri, 2 Feb 2024 08:08:45 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 675FD3FB34 for ; Fri, 2 Feb 2024 08:08:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706861325; cv=none; b=qNLHIaKC7R/MYlm8aM+1hwLiKzYcb/fui0UZX2Cni4iM18bw7oyIyTuADhqSyjX4ydh2dzoDZyKFhYMNbKORoSdxxe0JFzYrXETca6lOQbYnXAz782GEv/tAUjeoJfAyWHnhQNgjKVO7VEArJYvLf4gZX3GoXTJZ+V7LMt1wSI8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706861325; c=relaxed/simple; bh=1bnCWOCo19towQ1NBag6+0h207ceYs77u/vdiiGC3Cw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lZLqhZ9vKRZBFAOu/cNrJ0r3jPZsLOwBJUUb8tXm/LMZO/avcdf0E9i0nG5t8Tm3ELfJpr8WRcTIOvh3iaAlpFzLASkCvgSdfoTG9NbZJoeKmbsaVOlIyyjv91gMWkgRlJbE030YNdiL1ufFHX6Gn+67UTuJvf8WuYbhxkR9qaw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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) { -- 2.25.1