Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4453412ybp; Mon, 7 Oct 2019 08:39:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxppXLSBhbGPAQG5Vcg20OGb1fiPpu+8Bpi1yiW3RaMaJdLQYXotsIJcUFUjPvOaqm/3522 X-Received: by 2002:a50:ccd3:: with SMTP id b19mr28971853edj.257.1570462773333; Mon, 07 Oct 2019 08:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570462773; cv=none; d=google.com; s=arc-20160816; b=HTSL6MTwCBWoYqz8t7o/FhsxMQnlUqdS8CBat/cltw+Ic22sEoNvHCCQSN/6ROPXUX mVl1GTd8VuJG7Ex+jCYDQrt3vDqmjoaf/AihbFAjPbs6hbHqdAgz8q0k3Ams9rF90hTb H1zoryKE8MiKi6HLmoIFxWtkpX0QcXQzOCEImoCCDxREuIafg0HMMKDvYtk7joAiA8Jp 2qMvitwFHlYFY3E1jkcSJHdataBgVqbAr/YcssFrCgQD8wM//hcIuCSsPAEhgP6VIJ9c 8ghlrcB1a+w4pa1vIJJhYf0bIy6rdL6fAJiMx1YMiGytPUSDiRPVKpcugcEfx58cSBYm n1nw== 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=xMcc3X8CNpYNA6Bnor2Zf1Ztw6XUAoL94JearvezXQsrEN0XKk+e5+vrHqFn8CPD4P ekqpwwt28RaUAo9VjnjVj1IJHsHVqTrplTM5HkbpalFYFAwxaDKef3LaQ7AGd1PDlfDP o5cafQGgjB9gD3if1kMQeqrAOWowbQEc7LUOUrCUhphZ8ozhpwGzZFlBT0tkbEZ5jj9+ m374z8w7YHNpiIeUWusmyCAUjiFeWJwZphrsRkM8YSLFRN0Xd3PXN8uT3HIgEvE/V0LN WLaEhShKTygrzoGxYcNUpkssOSHwdVIdxueqiBTzQboca13OwyO3b9L614F1zh/NvXQv n21g== 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 b42si8730467eda.367.2019.10.07.08.39.10; Mon, 07 Oct 2019 08:39:33 -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 S1728810AbfJGPiv (ORCPT + 99 others); Mon, 7 Oct 2019 11:38:51 -0400 Received: from foss.arm.com ([217.140.110.172]:38288 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727745AbfJGPiu (ORCPT ); Mon, 7 Oct 2019 11:38:50 -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 25A0B15A2; Mon, 7 Oct 2019 08:38:50 -0700 (PDT) Received: from e112269-lin.arm.com (unknown [10.1.197.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 752493F6C4; Mon, 7 Oct 2019 08:38:47 -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 v11 03/22] arm: mm: Add p?d_leaf() definitions Date: Mon, 7 Oct 2019 16:38:03 +0100 Message-Id: <20191007153822.16518-4-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191007153822.16518-1-steven.price@arm.com> References: <20191007153822.16518-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