Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4323311imb; Wed, 6 Mar 2019 10:30:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwrCxpfaHCWBDPwiWlL578yyf6/JnZNB99fpG4ySKNGB7RByF1ikG4yha4K9wZIzJQgXjKS X-Received: by 2002:a63:d64:: with SMTP id 36mr7311904pgn.360.1551897051513; Wed, 06 Mar 2019 10:30:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551897051; cv=none; d=google.com; s=arc-20160816; b=nnnbjvbJPyPHb/H0fb2rtySJa0TW2GsMSRZhfCQEJDBjzNqWje/oM2zQZk1npAs8XL qKcVGTtJvixr/6BVe7GjoW7TNzuDE8Ix2kCCYAxFXG3dksmRb5ysI1N8Lh+DlLSBFnVq vWHtO01/zBmPhobZ9r85h/EV3J0imTO84Mf3WSDxr8ma+FlyHpdp/aHRDfSy77jx57cS QLy35ixr39aLOd/MBVY7hHDUMjYfHxQYhY1ip107uIZjitGE9EYVUWEb4dtg2NqmdeIw B6Nditwh/6RRtvch+LpkY+rGHzcFYdTtisfVShKH7AFdxu6UFL9xmc/3lCn01DwaCR9n ojAA== 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=qsXQmPprpxmuBeYVH9lG+Xt4hLaFoJ/AyXxwtZbC41E=; b=bdrMWH89ol5rR1IzevrIm8S9C/w6xaeRCahsS4vqWF+BzIn49x2JMgrnJHwz+JzECR RprV6ikEkXmKgZ/hVWTcnop1r8sbFA6KD8cfYfFGLRcrXWYNFj34uJ9GJC97RTKbffH8 Rtemk/vXjejvg0ziXD1M9YHnpu7p2aP1hjWiNxPhzbg9RSwi57++X8SDGZK6CypOuPRE CBrDyAoLaU4WUbMIstt2IozocOiGG0kAMGOpgZ8vDlyaGGMCGbHvT8/jxjQZNQySLa7U nhMU+y789TEhbgbH+GjkyaVSvsyq9f/JCy7UkWTxWOkPskh7cNPWg3N00l0RqtOPm/BL IX9Q== 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 q20si2034562pls.263.2019.03.06.10.30.36; Wed, 06 Mar 2019 10:30:51 -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 S1730041AbfCFPvZ (ORCPT + 99 others); Wed, 6 Mar 2019 10:51:25 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34478 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726512AbfCFPvU (ORCPT ); Wed, 6 Mar 2019 10:51:20 -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 15C1B165C; Wed, 6 Mar 2019 07:51:20 -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 CF1BD3F703; Wed, 6 Mar 2019 07:51:16 -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 09/19] mm: Add generic p?d_large() macros Date: Wed, 6 Mar 2019 15:50:21 +0000 Message-Id: <20190306155031.4291-10-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 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 p?d_large() macros, provide generic does nothing defaults. 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 05e61e6c843f..f0de24100ac6 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -1186,4 +1186,23 @@ static inline bool arch_has_pfn_modify_check(void) #define mm_pmd_folded(mm) __is_defined(__PAGETABLE_PMD_FOLDED) #endif +/* + * p?d_large() - 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_large +#define pgd_large(x) 0 +#endif +#ifndef p4d_large +#define p4d_large(x) 0 +#endif +#ifndef pud_large +#define pud_large(x) 0 +#endif +#ifndef pmd_large +#define pmd_large(x) 0 +#endif + #endif /* _ASM_GENERIC_PGTABLE_H */ -- 2.20.1