Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp382378rdb; Thu, 15 Feb 2024 03:13:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVx3uuR7O21DlnI0ltsyAF86Sen9zTzyb4jGAqHfIjqcAOCQwUEbxxBH0s8RjgOBa5J4T3/5uL1H5GcXMsHAFp2aoXcba0jNWwlnuVfow== X-Google-Smtp-Source: AGHT+IH66HWoA6k9YkY31Dsx6zdndyGG94JjIV+OMtjtTnh5dQkAjs1kTkKXuj/NzdzELbOK0ePb X-Received: by 2002:a05:6a20:6f04:b0:19e:4f18:b953 with SMTP id gt4-20020a056a206f0400b0019e4f18b953mr2081752pzb.16.1707995582278; Thu, 15 Feb 2024 03:13:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707995582; cv=pass; d=google.com; s=arc-20160816; b=Tkme7EIYATfPHgZWYuxfVUDq1m6EsEJcpphWvepFXb38gcWAMDUgxP2uAwcpV6HRIF DOLFYGUsLLjIiRAumi0Vaaw3ng1bHdnIdTxwOQSoFDju+ws9h5ootb9hEmI+693nVMJ2 ksF7bNhDG8KWX9jCp2htta4wd1SfF1/2tTZl9JQTxFD2DrQx6PXPrZvmmxdRCAtdlL5t gFrNUeFqXlNozI4B/RzAngq6BYecRBbJsikxLZqtd4zRwCyKvFTNoI11KbjkQNqYY0ya nBAG0xZpqMQ55Q4i2O5UT3k29fZcJ3OkuZ1uteEs0bXBSV8UxplTeVSkYsIN2njcxg1a NwGw== 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=rWO7ZiASv+iNEWh1oRqCx438LeAl19u3CVwsECquxEQ=; fh=Heagowc1O8zVDXTyU76nJjOwDjz9r3Gi+0zmhF4ZELQ=; b=g8lLm7Jo2fLHh5dhGLtkfdY4d5S5nOhqopQXyq6lUoQS/nZBwERafGwf9+H3iY2k0I RAPL8mIUdbqrW8tYGgEuD+12n9jqoePHQWJNAy3De3Z3NuM0K+1Vag34FSsVyvd+2aiu 8JZdOBh8dQLMe/JriEO5aelgIzZHWK44Asv8RdUkTaRqtF9eCVGOiRbakD2/kEvTisFr lT11rhm9ts0tRTLGp8OzZ+OqV3NVhzr67aP0HI3jsNGFI36If+fG5sVYD3vmF2M/FFln BZbbPDCDX6T9yMMdI/qiOZLNI8CL2soBIVGeSJzrUdTD0pGgI+gDVhWpFoHKySzGMfZ2 4SeQ==; 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-66639-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66639-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j1-20020a170902da8100b001db49e3d886si959225plx.558.2024.02.15.03.13.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 03:13:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66639-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::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-66639-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66639-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7CDC7B2AE54 for ; Thu, 15 Feb 2024 10:34:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16A0F12C529; Thu, 15 Feb 2024 10:32:36 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B11012BF37 for ; Thu, 15 Feb 2024 10:32:34 +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=1707993155; cv=none; b=YM1ZppHyi9dyiWholRuAW24bXfy0xLxZlHkq4BtbZT+f6xsoAgnqy8jORKsQHoDdJRQj0SHjW1ie2+aUIKOcwSscznPquQ5zUPP34WmTJwzNObIRo7Wa6/28k2EwZYbUoS0j/ZJla0XTxAFSV9o6/7YUsDrwcL0BV2dprajZDEI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707993155; c=relaxed/simple; bh=jaRLqPxfoaS5xa20g0zrcIskSnUTkXjKILoHiMbUoFA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=l8KTc1yIIsnxmOG0yWX3ARHSAbhIH9ZJ1QnmFpPo6qOx9ijQSNp1XhJInXKWYMoUGSBZL94PN7AzEHz9pJOdjMiyPdt+3R2Y/Vja0j8tZ1746nljiVr7W7hIBFSc+gGzaywM8+/ghIcN9FezvqV38OpYgkANLtdtl/fz7wTfSJo= 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 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> 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 override the new pte_advance_pfn() API to do so. Signed-off-by: Ryan Roberts --- 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