Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4442800img; Tue, 26 Mar 2019 09:28:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJnd19kTmPc8XkjaW5+gc9RadvSGAE9d6F2jrK7gBtlH5OAltyvREu+WWSlmg56I7LcW+R X-Received: by 2002:a65:654d:: with SMTP id a13mr30659270pgw.181.1553617709197; Tue, 26 Mar 2019 09:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553617709; cv=none; d=google.com; s=arc-20160816; b=ARPv/EmoTtx6NDmvkvDMfKgYm180rKIvA4PC0RLTiFzyY8ciP7hPij3yAhvFaqf1E8 jEmPuK+yN6BK2BzC77ib5AWSiUDqybZh8j4IIpThGz6qS2IIPTjx5FUJnd0MPUrItd9W xbjRSYLoK1fWwvqCUzawBgNj50tHpHlDmQNJ8OB6jC+oC8Jioc0I1oLPTlFc0EHWwRjs Re8Saxa8KdBaXcwAwtsYjv2j8NRLlzhVqLN9w7ql075xi3i5iD4TTxW0L+FTaqlFNkWN wRWfpTIKQW8apYAS+e9B6MCvLDDfaaVOFUTrpa2T3FG0XdcQ2otXr870zn5yljkPbswr gORg== 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=U1aR140X7RnjOrD7ClczvI1VvyAi5tuJM37h24SqYlk=; b=WeyaYUsCy9grpyRT9OKxX2hVKg4ftoJ0ZdI/nNRbwlMEc4F+XSDg/UFD70NmQ40Tbu 68tatMllmlmDPPAd5o1WoHYt+HlWnPGzlmuLrmvB6KAdc8ZXsQeSixsyYZEqLpNAeyge WDQXXZeLe/U+LV8g4lpP5Bw7shLMIQRvSx3+y+NhP2KDsZu4cMfBWvLS+vEcypsTS86y cP0pZPh6eFpxHcSLSm9b3iiOZpHGKCld5QW16rtNd43ZBSJDr1rjzPyp8BrFb4S1Mfyb D2yf5RtpYjhKD0K0C2VbOyJvRSKlISnGHXbp2PFY+SnChXFArv3ieByNnxAl8Tl3IKok a1RQ== 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 t1si16553161plo.371.2019.03.26.09.28.13; Tue, 26 Mar 2019 09:28:29 -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 S1732232AbfCZQ1L (ORCPT + 99 others); Tue, 26 Mar 2019 12:27:11 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:39804 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726177AbfCZQ1K (ORCPT ); Tue, 26 Mar 2019 12:27:10 -0400 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 B901615AB; Tue, 26 Mar 2019 09:27:09 -0700 (PDT) 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 7DA913F614; Tue, 26 Mar 2019 09:27:06 -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" Subject: [PATCH v6 09/19] mm: Add generic p?d_large() macros Date: Tue, 26 Mar 2019 16:26:14 +0000 Message-Id: <20190326162624.20736-10-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190326162624.20736-1-steven.price@arm.com> References: <20190326162624.20736-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 fa782fba51ee..9c5d0f73db67 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