Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp385451rdb; Thu, 15 Feb 2024 03:19:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVjIbejdyFDmj42SKiXeRx0IJogczLQz5n/Novm/7geemi5EzG0NVJO0nm2nY0bxssEoiQnk83Sun6SUcXeuDTnDS0CDN6pw3rMSYb0zA== X-Google-Smtp-Source: AGHT+IF0xggIzBsncF+/wAZcMWv9r7NqjkiMPccVj1PZtI5BDIf27fxdcBOxzXKM5l1j5EoWhaLC X-Received: by 2002:a05:622a:64f:b0:42d:bfd2:6352 with SMTP id a15-20020a05622a064f00b0042dbfd26352mr980470qtb.68.1707995981377; Thu, 15 Feb 2024 03:19:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707995981; cv=pass; d=google.com; s=arc-20160816; b=nSeJ53Y4i2nWjYwzjr7xEJhhYi6Cyi5/5cnQYi3KU9evO3nLk9gN/2rk5MrrebwiIf 8u6+rvPvOKJc6Dovfh6JAW0d9RA7eI9fAKAIrtd0Jxq7caJfevtEZ9h0ae/Axc1CAo67 0cRUn6dbDe5g7rPXDHij/44ANF8mox2ig9ENr/0eaZO+ZWdakz8mlaM4paqePFjqEYgc rM1oxuBAAPc9L0Qhf4RO5Lzkqul3wZ4TMzL262jUUopSJQ4prlJ7Rhg0z1vF3dcc+oWe fnTZPc6Pl4M9uAJzu7DbouNN/Be2feZcwAEsKwNchIaIGZM12QfpCiYmCyHiDw5eA8Rg qvgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=BPoSqlhEiUlV4rV1MfC8VrWLxITrY2ksWv8DtS3sCBU=; fh=L1spsrv307lYRQgjy/3hwbvQ7NVbJ0u3hqQHYo6XNQg=; b=QTplXcUUvN9xoZlCVyDCQd1O1Q8T1qu1HO/qBrOfE1bocDwxuknlq0p8zlueb+l/f6 v80AWkjbP+dbF1T4db+O2eu14sgKoyzTciYf5f+Fo5pFgbmMC+lvtBxBUP+6vSSoMq5a FyugiIdJqmscF7QdvITudkM3MZE2BVrz5HFJickfvK7Ao/eT8hwtcqAfHWkFflksjE+k dMU1ZIayHCnZ0yv7LsXG9pzw4t/77X5PtVWvBE9kT4zj5fOEi3wSfofOYlID6hIXHvyt MIM6lH3xtZjVoSVm+JjiqrFI5zn+K47giHo2U4vhJdEk+uBar7ePNFuh1DI9ozE4ZbLt fO0w==; 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-66770-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66770-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d9-20020ac85d89000000b0042c67c6f2a1si1171339qtx.608.2024.02.15.03.19.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 03:19:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66770-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-66770-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66770-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 26C6C1C2260C for ; Thu, 15 Feb 2024 11:19:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9631E12BF1A; Thu, 15 Feb 2024 11:18:13 +0000 (UTC) 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 >