Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6278290ybi; Wed, 31 Jul 2019 11:25:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2pHEGlM8Xc9gNA0qV15/bjfhR5l63V0mkpO4/DnpV9W+/8gkXc2qtbenjGga+bqKaGx6w X-Received: by 2002:a65:50c8:: with SMTP id s8mr75341587pgp.339.1564597557743; Wed, 31 Jul 2019 11:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564597557; cv=none; d=google.com; s=arc-20160816; b=qg16UGUzDqSp0yKFArh2kroN6/pjYKNHyIwBtj6nPjVXKKjjUQwzWqmZPMYpzTvlKK lgMV2ujDhVz9LagZ1aON/ZG8zMK3g7+wCUNmphdcI7/W/ZR92X8a6TJI1i+OcdZCEaDg 1cl34WAuLSjXGxEvwe6aVPV07Shj2JjZ1ZFCIRnnxD0dAW5Gr7ATpr11PczE6jp8sf71 SjMLue+d3kjJJLV6K5igjZ9vsPHsB+iqgXwOQf+lr0p8nzNAieNOuMN53PKEMFtGn6P+ urMpIF2xA6f9jqLkw+djXP4qwc+0bb3JCK5MnbPFVQPYUETPnxEgPb8qqNPLsyo2ZWFC ST/Q== 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=rGuXIhuIrNxPTwIll196uQ/ijs7BkCAaIOFw4iSU5my2kfSG/Q64AJhzkEu29elb2V Xo8NYw5sE2tYn6YLYQeeicFRcAd7ZEoqMyXvkFU7MgKph77UC026RWzYPtGM/C9Bm4j5 rfd98Fvq+27RZ7G2HORW5vnd2nPKYy1Q+6DFLOJ7p3LOucmHAL6ytcDYe7vtRFlDG8h5 H+XPKCv4oLbyGUIlclztEIhN0IbrPL6DEz804QGFUWAk9pvfdC1sbBIMP5BmkBb4T1u1 ewj9PAWOa9tXW4JT0Gef0U4wkDrihq/Mpe7v1pmQqvTUo1yyovtiQ6Y6XZyuIC1tGfo8 cELg== 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 j192si35585443pge.393.2019.07.31.11.25.42; Wed, 31 Jul 2019 11:25:57 -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 S1728079AbfGaPqW (ORCPT + 99 others); Wed, 31 Jul 2019 11:46:22 -0400 Received: from foss.arm.com ([217.140.110.172]:49548 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726962AbfGaPqU (ORCPT ); Wed, 31 Jul 2019 11:46:20 -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 668A21596; Wed, 31 Jul 2019 08:46:20 -0700 (PDT) Received: from e112269-lin.arm.com (e112269-lin.cambridge.arm.com [10.1.196.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B66633F694; Wed, 31 Jul 2019 08:46:17 -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 v10 03/22] arm: mm: Add p?d_leaf() definitions Date: Wed, 31 Jul 2019 16:45:44 +0100 Message-Id: <20190731154603.41797-4-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190731154603.41797-1-steven.price@arm.com> References: <20190731154603.41797-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