Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp207150yba; Wed, 3 Apr 2019 07:19:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRX7IFOxGh9aZMil2lmnY7gH4GoyZKWIJHycRQKFvQWPRTWlajMDNpuq6f63/3aiGENDtt X-Received: by 2002:a17:902:2a2a:: with SMTP id i39mr96201plb.211.1554301156429; Wed, 03 Apr 2019 07:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554301156; cv=none; d=google.com; s=arc-20160816; b=bn7b+YLOvX8oOJv71Ip8QMFCxFfPzLyVMsMYjDw4SHgdkmm87NksrDB3RXY6gPLLNx E7apqfS1THZWfw5hJYXHwhBAoQ89h8nQpq70EQFtcZLgD0oLxBA6AqXBw8SYef8Ain0s 2iRY+WIQjT5eJ0QvlIMI58rPDVq933w4fwHsGM3ijRntIu69kyxYaWgdLCxfHcQisG9t Bxzdw0/OVzzJb6cW62o9aTop9VjOCUVm9UYjuy0iNv5w9Cbu8rywaMFTLnk4DKm6Vcgk v760yBRunFuNBEgh6WWOoM+FI6AhH4HiRW8vHjGK5a3+3E6vM+ASmcq5KB+wuOA7TEZv VD9w== 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=dg2BY8arPuGCc0EN5/pzTP0ZagcxIE7H3sVhR3EppYefPnHZW3qVOqP1G0K8ezIn5F AxdtHPVmVL6cqXTHakhuQACwMGc/EBE5Bdm3BQ+/3cAmouLjWgo0cevtgXpyOjc1M65k hYspZJi5/28VbySM91G/CtG2v62eVZWGPaQbbO3OHoVPHjIiNlmczBbM5uT2wgiJVZo5 JGqwSdm/ZDhyaJ7ddc+v4c37vikEgoa6VSI+Ft2V+fwUNnGx6q3kNBGG93BJbzkpCPGA kKIPJCEPh9fpGOiZnaXPH/ZUQqsfW/k4ue9rQ9wkqvRNZu9pGpRE+Ot7KGg1erFvEdHZ Uxng== 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 133si14657304pfu.82.2019.04.03.07.19.01; Wed, 03 Apr 2019 07:19:16 -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 S1727489AbfDCORw (ORCPT + 99 others); Wed, 3 Apr 2019 10:17:52 -0400 Received: from foss.arm.com ([217.140.101.70]:41724 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbfDCORv (ORCPT ); Wed, 3 Apr 2019 10:17:51 -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 8B354168F; Wed, 3 Apr 2019 07:17:51 -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 2C3A33F68F; Wed, 3 Apr 2019 07:17:48 -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 v8 10/20] mm: Add generic p?d_large() macros Date: Wed, 3 Apr 2019 15:16:17 +0100 Message-Id: <20190403141627.11664-11-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190403141627.11664-1-steven.price@arm.com> References: <20190403141627.11664-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