Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4317877imb; Wed, 6 Mar 2019 10:21:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzMRiH1Ptl+oMuk3siQaMO7Kn/4/vu/B3Tfl3pTDwr8IeIdQvlrEvOh73H3Nxc/mqM5efWm X-Received: by 2002:a17:902:d702:: with SMTP id w2mr8423324ply.131.1551896519429; Wed, 06 Mar 2019 10:21:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551896519; cv=none; d=google.com; s=arc-20160816; b=xNQCn5/82TcT9fw6msmS5NIx5166xbOpXKL7xE2ixfEkI7eY0Tls9UIu2GUKUu6jmG fadpr7Nb69cvUtGNN6Ff4GAYeVkTDNVU13qM0GEGlj+T9+v7V/Pitde8YzOwWbKkj70w kAljMuY3aeRT/GjxDOb9CepNKZJ3KUWLu6QN9rFGS3YTsbMB+r+/pL4c6A9s01kLC8EF 6K2JzR4lqLjQoLML4TEv4d97szoZBKLpE2rMD47H58FV5m43ose4rjg/8Ld1/3r2Wl4o SsmYKC0mU+hBlU2kiCU0320sjA/adx5BnWe+KeDcyvdM1SZZXORsCtu2pRlTevWaB65w QVbA== 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=BRz1fLaVHJrWps04LeU/9kcyNHUo1yfdaodtNUtdXHA=; b=Xub7r3pnFMCGwJmR+9eBFhQ91e0PJ1j/gKU6e/1MJyjKGYgBwL64/eCPOCkeGy1+bI JZunrZhKCzperepq04ZpbzKMNiRV2K73eGTDDiUG4vf8j4kgbB6Q/Rt6WLXlMpRox6Ac xu6l567kwXfH7ZU7IIpASycuxHO4Df3ASSCz+bj7RT3FFNit+rXYUAtU9NwoXBsULth1 bsIuUmgU1lRSVyrLhtd9elFB82E9VvqOFNHzy6QPB+wgiMFTEPTdZAAWLvvXnPb34PNb yVKyRIl/LfBwujnVcIumkglHdR0Tu2FNqS13d235Zf6D2glaWtCN+ePKaoMz21cij6kk TkDg== 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 c6si2002870plr.166.2019.03.06.10.21.44; Wed, 06 Mar 2019 10:21:59 -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 S1729760AbfCFPuy (ORCPT + 99 others); Wed, 6 Mar 2019 10:50:54 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34220 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729359AbfCFPux (ORCPT ); Wed, 6 Mar 2019 10:50:53 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1612C165C; Wed, 6 Mar 2019 07:50:53 -0800 (PST) Received: from e112269-lin.arm.com (e112269-lin.cambridge.arm.com [10.1.196.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CF75B3F703; Wed, 6 Mar 2019 07:50:49 -0800 (PST) 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" Subject: [PATCH v4 02/19] arm64: mm: Add p?d_large() definitions Date: Wed, 6 Mar 2019 15:50:14 +0000 Message-Id: <20190306155031.4291-3-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190306155031.4291-1-steven.price@arm.com> References: <20190306155031.4291-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 will be provided by the p?d_large() functions/macros. For arm64, we already have p?d_sect() macros which we can reuse for p?d_large(). CC: Catalin Marinas CC: Will Deacon Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index de70c1eabf33..6eef345dbaf4 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -428,6 +428,7 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, PMD_TYPE_TABLE) #define pmd_sect(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \ PMD_TYPE_SECT) +#define pmd_large(pmd) pmd_sect(pmd) #if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3 #define pud_sect(pud) (0) @@ -511,6 +512,7 @@ static inline phys_addr_t pmd_page_paddr(pmd_t pmd) #define pud_none(pud) (!pud_val(pud)) #define pud_bad(pud) (!(pud_val(pud) & PUD_TABLE_BIT)) #define pud_present(pud) pte_present(pud_pte(pud)) +#define pud_large(pud) pud_sect(pud) #define pud_valid(pud) pte_valid(pud_pte(pud)) static inline void set_pud(pud_t *pudp, pud_t pud) -- 2.20.1