Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp760995ybl; Fri, 6 Dec 2019 05:54:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzcaAeycKRoHOcekLvPb1fn4mzw7PR5Ughf6CGDjCgZxsMnPZUDvCJQhcGr997ZI+jvrXQN X-Received: by 2002:a05:6830:16c6:: with SMTP id l6mr11160790otr.186.1575640480886; Fri, 06 Dec 2019 05:54:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575640480; cv=none; d=google.com; s=arc-20160816; b=GVLal4a5jP6duE0v1kCPEUDaneOvTfa9HLTnAuQm/qPhApE42T9FRv5rgAmSBvd12+ DkOi82zMBf3XQLoWne63o+TRr8LP+5M7MGgP+L07VwjEi6TcjK3whbgGItg7glkC7e6p 1iEITi3W0vj5YQ//+lIHscd58ycU50N5gwI8PAflI5Jh62hNKleJkr1gGjhhZtqk/QY5 Mod0tAlkT3ef9N0BeacTZFLvSdV40DXJNkbNeXAjlYJPg8ytt6/7l/IaXbhYKevccp4b eUXv3NSN4phlHqob/UOysKLqc5kJ04B5w/Kf1watyyqd9IaaUGpCy/Q0sIr592RFbHwC +96A== 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=dICKltiFGc1OgofLIsT/Bgm36XqVF9vEkkJsvRrYgSz5+eLl+v16qTYvF+vQ0u0KIv 1gDD7lZknNpAQ51jlfEnK4awd0Nwy6M+Ufvv7OaUCC3588+bIajW1y1W7C+P5rnlBURh tri0YXLOv/uWozKXc+s8Cw1kgfR9EN2VhqnTNtFDUhsb2MlILiope/IvUUD0QYrh2jeR 9NDURbqTbHyXPcNZB37ERcHE38N6aQBF+JTlraCCDvAA2R7ls08Y2xQUizeaS2wKdsCw o9WelQWTCAQpl0mvXeQmhUXsqmT9LxZzAewDHOJFJrT5y/+gEvY/xYHKsxs+2qc4mess aedA== 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 j63si2229219otc.291.2019.12.06.05.54.28; Fri, 06 Dec 2019 05:54:40 -0800 (PST) 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 S1726453AbfLFNxx (ORCPT + 99 others); Fri, 6 Dec 2019 08:53:53 -0500 Received: from foss.arm.com ([217.140.110.172]:44434 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726395AbfLFNxv (ORCPT ); Fri, 6 Dec 2019 08:53:51 -0500 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 A0ABC113E; Fri, 6 Dec 2019 05:53:51 -0800 (PST) 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 06AF83F718; Fri, 6 Dec 2019 05:53:48 -0800 (PST) From: Steven Price To: Andrew Morton , 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" , Russell King Subject: [PATCH v16 03/25] arm: mm: Add p?d_leaf() definitions Date: Fri, 6 Dec 2019 13:52:54 +0000 Message-Id: <20191206135316.47703-4-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206135316.47703-1-steven.price@arm.com> References: <20191206135316.47703-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