From patchwork Thu Feb 15 10:31:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13557854 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 99FB6C48BEF for ; Thu, 15 Feb 2024 10:32:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 28F258D0019; Thu, 15 Feb 2024 05:32:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 23F0A8D0001; Thu, 15 Feb 2024 05:32:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 106588D0019; Thu, 15 Feb 2024 05:32:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0091E8D0001 for ; Thu, 15 Feb 2024 05:32:35 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id AACDEC0F4C for ; Thu, 15 Feb 2024 10:32:35 +0000 (UTC) X-FDA: 81793674270.21.B152087 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf04.hostedemail.com (Postfix) with ESMTP id 433784000E for ; Thu, 15 Feb 2024 10:32:34 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf04.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707993154; 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=rWO7ZiASv+iNEWh1oRqCx438LeAl19u3CVwsECquxEQ=; b=1A4gb1huIhPg1i2G4gl/nPF9X9wx4rh1Z7A6616Ac/QsNg4rlDhPOmto4w6loMooLLDmDP 778eZUTkZJ0fXkk/u10fJoDPjhNywU8O2EHupQzWtKNj/mB8YQUmzLkl+fl9X/RMRa7oEi T+53QHRlJV7GMIHvZsljMBa7jSJsXqM= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf04.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707993154; a=rsa-sha256; cv=none; b=xYHBboemuXEYP6kPwnf5PvZg8dXP6IZHNf1c0db7tcd2vx4gZzbGmj8Y4VuSAZ2Qp+3sUL e5joOuaJkjud1aDG+jewT7zhEBwpv4psJJhYplb83Qv7i0okbqNcrITAM1CzzsZRtfNtix j+xWHc4raa3GuJSrHGJcdUko2qoS+Ls= 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 7862D150C; Thu, 15 Feb 2024 02:33:14 -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 6F72D3F7B4; Thu, 15 Feb 2024 02:32:30 -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 , 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 v6 04/18] arm64/mm: Convert pte_next_pfn() to pte_advance_pfn() Date: Thu, 15 Feb 2024 10:31:51 +0000 Message-Id: <20240215103205.2607016-5-ryan.roberts@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240215103205.2607016-1-ryan.roberts@arm.com> References: <20240215103205.2607016-1-ryan.roberts@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 433784000E X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: pdg9rqs7qtjeaxbodr9p6t48crjr96ai X-HE-Tag: 1707993154-375599 X-HE-Meta: U2FsdGVkX1+AOk/VMcnJepC+hzk6SQ+rMGIo1YVAtMh46MljnvPtIayvH+IwARm9bhqevyoMC1mLFKGvFwJ0wW4vM2JUM5SuJfFu8DfqPc5if1W4rFeALZgCUSPMxxahOBJ9axwbBz1GVoAxzzrygK35aaIaV358xb12ar8YbVhfra48BxYxYL/+Qp8wfJwrMXQLKV1T8lHq3DBbiRAUKnLtXC96wTmxoeQB2sRECzd3684s3lp1rbv7BJxphqf6HhB0txe5RJvR2v5AzxtfcBAfhQ26qapbMevfytP5B3jj4t3fprqMG4Ms9yM3PXwgLPPkc+XQTa6F39oaFGRg9/Tb2CTl2za2FCFU0D93uuNgYF26JAzRQAoNnVBmRrWhMjUUdPV6huELrpkbt1akxakhtjUf0sqYec+yyXftnn7saaM/ttBYGPAhiP5g4vw3KosQlCljRRSN1bwCcME4kRckkFcQ6w2vNt6SOcVhGN2AAoq8oQJOewcNnSY1XrcY85VnnhZZvmx36YRPZeaJec2VBC2kwY/LU55dI+mqFqF2hcTb/6xS0+HOqS++U9KoUSqHoeBAT0i2YQn8AYK/OI1EHHnDEFHwdRiN6YjQ5zD3os2d0XVgiQUAsTSphh8Yx0rmXwJhxlsf76edm81b7rxZSKZ+lgPUQkIr7koOQKBspwNr5gY7IjXHrl1hcSoBiNBZzqi+eu0uakbiKY3xbY75Ow0rAfSgpEX//TX/pGYgAZwZnVpK0fVpFxJ085E87tOsh/hZY03eSU5N07rsAkurfQlqNuUcnLjvsdfhJhhUJwYHGL/R5IeIYOuVftaZhS8GSD/eSKUNag6on9PnBdE4WJVVNhwY8mSHoqGRpfU3ecJoxtAft74ybQn1F6tjHHOuBw/MUHV9va2OuQtrQ7KOWrIzMosSUdbV9N2/1RBzkSNde5W9ARcOm8O2A6FpShyilPf0KdUpf4crW0Z ScQ== 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 override the new pte_advance_pfn() API to do so. Signed-off-by: Ryan Roberts Acked-by: David Hildenbrand Acked-by: Mark Rutland Acked-by: Catalin Marinas --- arch/arm64/include/asm/pgtable.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 52d0b0a763f1..b6d3e9e0a946 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -351,10 +351,10 @@ static inline pgprot_t pte_pgprot(pte_t pte) return __pgprot(pte_val(pfn_pte(pfn, __pgprot(0))) ^ pte_val(pte)); } -#define pte_next_pfn pte_next_pfn -static inline pte_t pte_next_pfn(pte_t pte) +#define pte_advance_pfn pte_advance_pfn +static inline pte_t pte_advance_pfn(pte_t pte, unsigned long nr) { - return pfn_pte(pte_pfn(pte) + 1, pte_pgprot(pte)); + return pfn_pte(pte_pfn(pte) + nr, pte_pgprot(pte)); } static inline void set_ptes(struct mm_struct *mm, @@ -370,7 +370,7 @@ static inline void set_ptes(struct mm_struct *mm, if (--nr == 0) break; ptep++; - pte = pte_next_pfn(pte); + pte = pte_advance_pfn(pte, 1); } } #define set_ptes set_ptes