From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BAA1E129A75 for ; Thu, 15 Feb 2024 11:18:10 +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=1707995893; cv=none; b=ubZS4xSP17zQZqSxy6CtiTAV7kvM/euf1/Yw5cnhx+cUzFA5YbIVXqwcJCk+H8T21Cakgp3yXku0vB76GcBrr+uV3ZWcEpYSDbPca2L8N/UTPsJagx5WRT2hida9hH2A4Zm6g9/C/jZ7XALizT1K/xEKh+xc6jwtcoxIDuH+nHc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707995893; c=relaxed/simple; bh=7s517DU1+XIeug053V9PEoRjF3zuZRpKTr3VpuJA2/E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JOKS/KbtHq5wNANJ+C+hiGCwfoJyGheDko+OqpriZa7uK22ErFNdNSeLYmH5+/dzT3bnbl9YR6V76Ke0xCw5Gfn1Tk6EJGOeTXUfv+8LS8kHdfbzxyi0M4zp+XNSGMrKN8rnuxH2SQz8COOILz1oWAyxyaLr4MbMonbKZHBH5G4= 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 C5E321FB; Thu, 15 Feb 2024 03:18:50 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.68.11]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4EFFD3F7B4; Thu, 15 Feb 2024 03:18:06 -0800 (PST) Date: Thu, 15 Feb 2024 11:17:59 +0000 From: Mark Rutland To: Ryan Roberts Cc: Catalin Marinas , Will Deacon , Ard Biesheuvel , Marc Zyngier , James Morse , Andrey Ryabinin , Andrew Morton , Matthew Wilcox , 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" , linux-arm-kernel@lists.infradead.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 04/18] arm64/mm: Convert pte_next_pfn() to pte_advance_pfn() Message-ID: References: <20240215103205.2607016-1-ryan.roberts@arm.com> <20240215103205.2607016-5-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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240215103205.2607016-5-ryan.roberts@arm.com> On Thu, Feb 15, 2024 at 10:31:51AM +0000, Ryan Roberts wrote: > 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: Mark Rutland Mark. > --- > 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 > -- > 2.25.1 >