Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp382335rdb; Thu, 15 Feb 2024 03:12:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXfrsk8sr/wDMtu8N1h6gtA130oRPMmRfvdetp0sdZFl8jflnuGxTpyB+9tM91p5knK7JqULEfpWxM7VhRBKkYFSdMvAXgOrtsZO1j1eg== X-Google-Smtp-Source: AGHT+IHxsY27XuKv7rmocz4NuRGP4V8jyjw1UclmMwXLEVnX9iMxEHNkKjtUw+kVquYKUtO9o4ee X-Received: by 2002:a17:902:e882:b0:1db:465b:b5a3 with SMTP id w2-20020a170902e88200b001db465bb5a3mr1486981plg.11.1707995573243; Thu, 15 Feb 2024 03:12:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707995573; cv=pass; d=google.com; s=arc-20160816; b=FOp5xKtKYUP6VeA+0Ux/BDBW+s3sN9vItZJvrD3rmQp0B8fn985uyxBFyVq760E23F L9Ax4i2BHifpjnx096WkcJbsagK22g++Mx878Ynw6/u6+j2c4zPvw5yvX7zD2rgNeHok J5jcGv1uI8HxGKFmXH8bjpsPqb6JMjbTc3leca6MpiC4AgdFk2AAsAUl2YYTxeZzdkEE zjIMso210+kG4RAYuTvF++e7IbFlnsV3IkXRUd9Cb7coYzZBkTEvUsA3bpkLR+NIfgu3 sS+dGrA2Rbjb1wwuRUD9ACmbCaMPy8fuVO+i2VZVW+jLvG+/YD7M2uaioHBTGRcWDXnx SLbQ== 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=Vt7HWCdphupCFZjtUl00kIkT38SYH1HEWXlJCnuRk3c=; fh=Heagowc1O8zVDXTyU76nJjOwDjz9r3Gi+0zmhF4ZELQ=; b=W7CyPzDwLaRpEHkjF/c5W6OLK+jAxooyeekiBRVjGQbEJ4ddAvbGIAHNcbXwKWFguN TreOXVovS7cIfV3lxvU0YE5pdjQQDFH07ZHvXhfTuhbDG8BUbCHiJ7Mi0DkkdPCqdzlV LEJTGyjHHwCOpg2nP8zE9y/05GOA/bFPQgEQiwbHE1OeDi2hIg1jgxm1HlgulL/VWgIC oAC8dRvysqrRpOzWVpjporsVmORcCvJe1FvUhip4I8z002Cv8cTcEIczrrBrdWbqgwLP Zg+OBeKhDaZMilFNIlEm7xgB/0oGNqzxUgoRMQ8791pXj1utkJNyUeWcEmb0FssEoe4z Z1fw==; 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-66640-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66640-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. [147.75.48.161]) by mx.google.com with ESMTPS id c1-20020a170903234100b001da237e483bsi998976plh.67.2024.02.15.03.12.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 03:12:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66640-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; 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-66640-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66640-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 57030B2DEE1 for ; Thu, 15 Feb 2024 10:35:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5EB1012C7F5; Thu, 15 Feb 2024 10:32:39 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6193512BF16 for ; Thu, 15 Feb 2024 10:32:37 +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=1707993158; cv=none; b=WdZTKndtZgBn/CYJQ2hlzzKcWVqS6bbXZUqnO3Bq2/YLUIKa0s0KQKavPS+G7C7UXw0kqhkD98ixwqMlWRP2U6BJmNU9K826xv4kjNa4Flco12h7t+PlWCGufcGKXrJwSSr8P8xXPgBAkZTFipkEjqU9OZY1bTJpmim10CVC4Po= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707993158; c=relaxed/simple; bh=QKKxOEWZPFqFjzK7t69u40gkIRbUK4JElui7wOCLF0I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=M7j9B71u0jj5vFiV4OQU94zrXqtCYzoTsB4Q0cwu2jfuVO1bbdTEhNaVIQMtFUhresRbRK4yEoDGsJWqtnY+HkfPCm+eSovvwKgXSIYb/g9Z7vebOJD4C9soewive9RA6+evZLOfS9lG68PVXm4Cn99v8AMIyMxL/ugZeMh6Ejc= 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 DDA7C1515; Thu, 15 Feb 2024 02:33:17 -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 D34703F7B4; Thu, 15 Feb 2024 02:32:33 -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 05/18] x86/mm: Convert pte_next_pfn() to pte_advance_pfn() Date: Thu, 15 Feb 2024 10:31:52 +0000 Message-Id: <20240215103205.2607016-6-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/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 b50b2ef63672..69ed0ea0641b 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -955,13 +955,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