Message ID | 20240215103205.2607016-6-ryan.roberts@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-66640-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp331844dyb; Thu, 15 Feb 2024 03:33:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVPy0PVrtb5jGrDFnZe2kPhrTgR9tsgre0HWooCO9ji2h8ObwcxWDQoV72BgheVPoSLqRHtrEScPLT7BPuOKiubJmjVmw== X-Google-Smtp-Source: AGHT+IEiHjpPnkqKwlkxKCsJRmOOLG5xmb/NQB6vLwEINKf/YNsHu9EnKIWk9oOXM8QO+qO2TNKl X-Received: by 2002:a17:903:22cf:b0:1d9:411f:4303 with SMTP id y15-20020a17090322cf00b001d9411f4303mr1599665plg.9.1707996786080; Thu, 15 Feb 2024 03:33:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707996786; cv=pass; d=google.com; s=arc-20160816; b=sswlNsR2Q9sIhN2zRRM87Xdy0OzYMa+jt7wpu945oqPUZOEp0GAUqF8RwbZ5NcV+1X vwypYW01djvOy/EhdL+5aHPd2jh7mh14li+kxIGumimY/jI8KPf7I73/OAPA8ghYOyrk EgNJtefZjE4ltX+7QihxbWpYQEN233Rz7l2TSExL6QuEFLfRCXu5/kSzJtij4YAKTD+C vx/n1KIIu8KITU3Z92BzQ/pmoBuH7KQvp5rEZgD0b53m3tYFdzdWgBIlHXswmTlJ6j8W FGObZ5AP0Z58fCYM1yWqRRSo5OjWIo6A2wW2aggKyLAeqUyEapvLPgi+7C1GRUbO5Cp3 pJDw== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66640-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k3-20020a170902c40300b001db730d3f1bsi1002030plk.610.2024.02.15.03.33.05 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 03:33:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66640-ouuuleilei=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-66640-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66640-ouuuleilei=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 B07E3B31EFA for <ouuuleilei@gmail.com>; Thu, 15 Feb 2024 10:35:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FF9812CD8D; Thu, 15 Feb 2024 10:32:40 +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 <linux-kernel@vger.kernel.org>; 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 <ryan.roberts@arm.com> To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Ard Biesheuvel <ardb@kernel.org>, Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>, Andrey Ryabinin <ryabinin.a.a@gmail.com>, Andrew Morton <akpm@linux-foundation.org>, Matthew Wilcox <willy@infradead.org>, Mark Rutland <mark.rutland@arm.com>, David Hildenbrand <david@redhat.com>, Kefeng Wang <wangkefeng.wang@huawei.com>, John Hubbard <jhubbard@nvidia.com>, Zi Yan <ziy@nvidia.com>, Barry Song <21cnbao@gmail.com>, Alistair Popple <apopple@nvidia.com>, Yang Shi <shy828301@gmail.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com> Cc: Ryan Roberts <ryan.roberts@arm.com>, 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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790962212279053053 X-GMAIL-MSGID: 1790964437691539427 |
Series |
Transparent Contiguous PTEs for User Mappings
|
|
Commit Message
Ryan Roberts
Feb. 15, 2024, 10:31 a.m. UTC
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 <ryan.roberts@arm.com>
---
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) {