Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7302109ybi; Mon, 22 Jul 2019 10:36:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIgB+pc7ufJ/481/dr/oopGa9XOqTkp2Lr+aVMBl3vQ+hoIszYblVAZP0xwOPr68XgP8C5 X-Received: by 2002:a17:902:be0a:: with SMTP id r10mr72235933pls.51.1563816962914; Mon, 22 Jul 2019 10:36:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563816962; cv=none; d=google.com; s=arc-20160816; b=Pi6NCSo7Oa5CeHQieDlhYLU5br0rVRHAHswExoKxRIZcIBHFEf7Oc8vZ9lfzoL7Zji iRVPQ0RxUOFGheOI8DsnAxMbRAu7B8hlyrx4DJWnvkRbu7dbKzdKlpF2twCcu2CBEwCD v6G3QZKCVaiWAnW61yn3FhyLt1MsgXPLauB9hyXLvXkUgFQcu0d5L5uZQ0b4bEZZX6Cz EnS5rD11/n+QnaRPl0Opy57vVYOFKfG5k1/E2Fgf8RBiFQmC9X2u0qXAUKiveHuMxibI 2r2lODcxz1x49DoUE/uXsRzk+occOa8ngvSPMHprlixcyvozI0CUEGS1Pr5WFGs5tkwo +fQg== 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=o6ZQFuOhWTxaUQNBYLtlSVNvlI+gAHzIZURutjw1lXA=; b=a2Y3d/Mp0sTLXMFqPeozbVKlbEFjFfIRO0uRBhEn+HQ5/ANuXuUMkpaUgiFid0kOew NvArlUeClw1HLnA8yfPFhy7z5iRHQWLVShTe8NirgZaNBjaTaitFwQYdcvGl1iuEzYbR +9aKjKMExAxPO9taBQOHRsaXBIUXY0FdGfkLYZ17oPgjncF3NC1eObPp68xh2e7d23GW S1CXhu0V4rdBW31LR0pA2jT5rLWjFoJ0bpUQvdkwMRPg6z53XKc94A6tvaDgxgq790hB mGw//Xp4VdHQmTJdw0NroxkPlKg4s2OlkTw/4Nox+MbamOY2Z5Wp9R1NoMlCrrQHXEFw 3ezg== 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 14si9867021pgy.255.2019.07.22.10.35.46; Mon, 22 Jul 2019 10:36:02 -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 S1729885AbfGVPm4 (ORCPT + 99 others); Mon, 22 Jul 2019 11:42:56 -0400 Received: from foss.arm.com ([217.140.110.172]:40294 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729862AbfGVPmy (ORCPT ); Mon, 22 Jul 2019 11:42:54 -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 98F461509; Mon, 22 Jul 2019 08:42:53 -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 0FAD03F694; Mon, 22 Jul 2019 08:42:50 -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 Subject: [PATCH v9 10/21] mm: Add generic p?d_leaf() macros Date: Mon, 22 Jul 2019 16:41:59 +0100 Message-Id: <20190722154210.42799-11-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190722154210.42799-1-steven.price@arm.com> References: <20190722154210.42799-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 Exposing the pud/pgd levels of the page tables to walk_page_range() means we may come across the exotic large mappings that come with large areas of contiguous memory (such as the kernel's linear map). For architectures that don't provide all p?d_leaf() macros, provide generic do nothing default that are suitable where there cannot be leaf pages that that level. Signed-off-by: Steven Price --- include/asm-generic/pgtable.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 75d9d68a6de7..46275896ca66 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -1188,4 +1188,23 @@ static inline bool arch_has_pfn_modify_check(void) #define mm_pmd_folded(mm) __is_defined(__PAGETABLE_PMD_FOLDED) #endif +/* + * p?d_leaf() - true if this entry is a final mapping to a physical address. + * This differs from p?d_huge() by the fact that they are always available (if + * the architecture supports large pages at the appropriate level) even + * if CONFIG_HUGETLB_PAGE is not defined. + */ +#ifndef pgd_leaf +#define pgd_leaf(x) 0 +#endif +#ifndef p4d_leaf +#define p4d_leaf(x) 0 +#endif +#ifndef pud_leaf +#define pud_leaf(x) 0 +#endif +#ifndef pmd_leaf +#define pmd_leaf(x) 0 +#endif + #endif /* _ASM_GENERIC_PGTABLE_H */ -- 2.20.1