Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1728538ybg; Sat, 19 Oct 2019 01:13:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqykeUJonPph8W2bEts4ft2FMzD4qOvx4fi6JKo2vxNHGonWol5nmJh/kX97TzNCTDv50KZD X-Received: by 2002:a05:6402:1b92:: with SMTP id cc18mr14290024edb.129.1571472791706; Sat, 19 Oct 2019 01:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571472791; cv=none; d=google.com; s=arc-20160816; b=zRScyvNqhx59IqhqmQHlVMXECoa+5lpBxkOXnaU+46lpSsOdIbU36XnPZHZ2OhFt31 TmdvAVoC0ZCUF+hu6ARTphvI/hRZjAyAFbCDgiVW8AxXGXSlSnleFONUS2yalieqhL/c o0K8ZmPKWts1L2mkIj6Ri99TJs07z9Zta5dTDuCTIkTeBybKNxZ3Eql7GuVhrXHLIj+s josCbX7FRgJMuxwDL0ACENfXw4p1PGwdCFtetL/0Up2CmxhavSQg6E8nCZaP8syT9erb tcX/3ozOoWIWkD/0BT0Lxi5Sj2pjElXbsJ1pRud+4jASjrECnqrL719B5z2ugCf5nAf2 qG9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=eKl9NY7OTKmyYuPsGrRoNPFWZw8MxP6jB3gNXjnh+E8=; b=Q+/PMTapPukrIxSzM3dJBbpA6DH3Bc0w2ifQR6WbOnXjpFqdvSV6nQy9Cv5EwCSN1x PunZvJNugHymGZxUdXPjjRRJUrZsAKilCXZKyu37WHkxoLPhLawJd/fcSg5TNfdfe918 hmIjypXLTLi1yhSd2C+jQs5Fp8rwaOXMObRyofG1FUmEZxk+sEhjRugYC2RW8u7vAljG kLymWUA4negqMF7jaYhdx3qdklqf4Y0cra3/B3jRhf+cG6DkIFXu6pOIJigEXVPvkNZv f/zRVT8oXLzUkcicILhKp49I5nLfpMby+jrdX+VmUx2nPjgREB26ew+meP2BhJ3N+4zj +uKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b34si6192081edb.439.2019.10.19.01.12.48; Sat, 19 Oct 2019 01:13:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633372AbfJRKNg (ORCPT + 99 others); Fri, 18 Oct 2019 06:13:36 -0400 Received: from [217.140.110.172] ([217.140.110.172]:60866 "EHLO foss.arm.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S2633333AbfJRKNe (ORCPT ); Fri, 18 Oct 2019 06:13:34 -0400 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 9932A4AC; Fri, 18 Oct 2019 03:13:09 -0700 (PDT) Received: from e112269-lin.cambridge.arm.com (e112269-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E4B3C3F6C4; Fri, 18 Oct 2019 03:13:06 -0700 (PDT) From: Steven Price To: linux-mm@kvack.org Cc: Steven Price , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Dave Hansen , Ingo Molnar , James Morse , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Peter Zijlstra , Thomas Gleixner , Will Deacon , x86@kernel.org, "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , "Liang, Kan" , Andrew Morton , Russell King Subject: [PATCH v12 03/22] arm: mm: Add p?d_leaf() definitions Date: Fri, 18 Oct 2019 11:12:29 +0100 Message-Id: <20191018101248.33727-4-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191018101248.33727-1-steven.price@arm.com> References: <20191018101248.33727-1-steven.price@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org walk_page_range() is going to be allowed to walk page tables other than those of user space. For this it needs to know when it has reached a 'leaf' entry in the page tables. This information is provided by the p?d_leaf() functions/macros. For arm pmd_large() already exists and does what we want. So simply provide the generic pmd_leaf() name. CC: Russell King CC: linux-arm-kernel@lists.infradead.org Signed-off-by: Steven Price --- arch/arm/include/asm/pgtable-2level.h | 1 + arch/arm/include/asm/pgtable-3level.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h index 51beec41d48c..0d3ea35c97fe 100644 --- a/arch/arm/include/asm/pgtable-2level.h +++ b/arch/arm/include/asm/pgtable-2level.h @@ -189,6 +189,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr) } #define pmd_large(pmd) (pmd_val(pmd) & 2) +#define pmd_leaf(pmd) (pmd_val(pmd) & 2) #define pmd_bad(pmd) (pmd_val(pmd) & 2) #define pmd_present(pmd) (pmd_val(pmd)) diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h index 5b18295021a0..ad55ab068dbf 100644 --- a/arch/arm/include/asm/pgtable-3level.h +++ b/arch/arm/include/asm/pgtable-3level.h @@ -134,6 +134,7 @@ #define pmd_sect(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \ PMD_TYPE_SECT) #define pmd_large(pmd) pmd_sect(pmd) +#define pmd_leaf(pmd) pmd_sect(pmd) #define pud_clear(pudp) \ do { \ -- 2.20.1