Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp2018717img; Wed, 27 Feb 2019 09:07:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IZDHB/1VXhiUOfLf357WoKLbr/Y0lmHWJysnvmVJildxRh+rw0JvdUz/8zHrpSOqV5zeyda X-Received: by 2002:a17:902:f24:: with SMTP id 33mr3068398ply.47.1551287257195; Wed, 27 Feb 2019 09:07:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551287257; cv=none; d=google.com; s=arc-20160816; b=wjJmQe1zkgCBxP8Ux5P2d9KFebUW0mVSVzbs+1BxSWO5G53cm6cLdzLlkOKSUqgsPI SNcOUT6J0rO4cL+qa6ArLtiIb/1v5JFoyNI4jyPlXDSe9+2r4PnWTPkxZS3GEq0U8rxb qYFj7mMRM00YF6TgWspgIhLK6ZcALS0N4thKsmWVyuZIUWsEEybOPPQjadLnLTguaDFl HIi/wxKXijPloT5VfrsnKHzARU54WlWGa707cFdHejJJg/ukiYViBCc6DBXtw4Lk/OU8 UYjwvJQi6zJxb/hIRF88m29AhfOr3yXcngNXHgRwXm55G6E+l6UlJEpW/acatMuwItaL TMDw== 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=cOEu+PnP+Mtn2f637hjHq0T4K7M8AIvYx0DFGZ2Tg8vTawrDaVboZUZ9HQ4SWv8MGI hBuzKpIYklLbUI2HLmJrsnhYqssDnvDlsw5y1Vku0RVhjhzeApE8TNwROFIp0JfopQqd Pxy3IoYrba3sbeLLc+Sz8nb4mMCF8yLd7sbJm81wmnd7C2AzWPBl1gmn3x0IYXz98VGa lrhSuiFXbnfPavdId/6iA2yMKjAUeq+QTIO/tHu2fSgUqx7YmGt05zD7/YDBNeAqvq5S +qKuyoTTPn7Cyv5s9Se5+Tah63qUIbDjVMWr/7pR76FkusGWOuT6NFt1HgbGRAA7Wu/q GKOw== 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 b38si12314033plb.249.2019.02.27.09.07.19; Wed, 27 Feb 2019 09:07:37 -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 S1729948AbfB0RGo (ORCPT + 99 others); Wed, 27 Feb 2019 12:06:44 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35866 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbfB0RGn (ORCPT ); Wed, 27 Feb 2019 12:06:43 -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 1ED3A1688; Wed, 27 Feb 2019 09:06:43 -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 D7FD83F738; Wed, 27 Feb 2019 09:06:39 -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 v3 04/34] arm64: mm: Add p?d_large() definitions Date: Wed, 27 Feb 2019 17:05:38 +0000 Message-Id: <20190227170608.27963-5-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190227170608.27963-1-steven.price@arm.com> References: <20190227170608.27963-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