From patchwork Thu Feb 21 11:34:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Price X-Patchwork-Id: 10823839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56E3A6C2 for ; Thu, 21 Feb 2019 11:35:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4585830717 for ; Thu, 21 Feb 2019 11:35:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39CE330764; Thu, 21 Feb 2019 11:35:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 654D930717 for ; Thu, 21 Feb 2019 11:35:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 062298E0076; Thu, 21 Feb 2019 06:35:30 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 011878E0075; Thu, 21 Feb 2019 06:35:29 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1C4A8E0076; Thu, 21 Feb 2019 06:35:29 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 8542B8E0075 for ; Thu, 21 Feb 2019 06:35:29 -0500 (EST) Received: by mail-ed1-f70.google.com with SMTP id c18so11179632edt.23 for ; Thu, 21 Feb 2019 03:35:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=CXiwyxpsYbtktJw1JiQrFKlxs5Eu1bgqDSTeXz8tQMY=; b=URCacJ2xd9CRVm9iGtg7g9xP7TES/xD0Kr/P8Yk04gpszkJzcX1HXIQVBNNxtouAMC eTTVr2ZBf745aas44h2BIgmqAHm2SLdUPlpgKD3lnHAd88H+I2fyX465lNnQPBHjU5Su 6GcA4aFeaMQKoJxEoFQIDJk8YCeoYGjHQIXPk8HYGCu2s8bmD7eBWGzzaeSiG+WWEKzR cOq0LrcEO1f+VuuTmJdrW/tBpCQSCxBkKjEEfAri8Nt3RmEhpwWcBGL2hXVaHTDHzqwB yhSrpxQpa6DV1JJIblOT6POGbRn6Hrs02wabpYaYpFmZrS+kddA9yaSbfI1IUdOPFQYw bSIQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of steven.price@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steven.price@arm.com X-Gm-Message-State: AHQUAuahxXkAC8FtyWtulf/6oi7XjPI0LWtQk9s8NI1oTBLOhC4/jyCs wH0f3mW/6QMME2iCb0FrJv73WvCbEDif/+mDHBGciLB8u7nmL6KSJK2aKTzlo6hB8d88XOr4CGp 3/6lWUBmomxmZem9wrIpX0BtaXl4P+hQn1aaCaRYirDkSMSmhVKFBuaxJ99c8p61WbA== X-Received: by 2002:a50:f5ea:: with SMTP id x39mr28548977edm.154.1550748929040; Thu, 21 Feb 2019 03:35:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IayJYreM9rZSt5CGDg38IVAPURNqdK5Qbhu6oU9c9NX1xHVirgNlg9UectJ7pJtn30GeSoO X-Received: by 2002:a50:f5ea:: with SMTP id x39mr28548920edm.154.1550748928047; Thu, 21 Feb 2019 03:35:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550748928; cv=none; d=google.com; s=arc-20160816; b=fCpbO+GcrbiIxi5GETKl8pLJjgSz6RIwPEawtaswGgrnFlbGt9o0PfF91JMQNKvIFk JzEiHeo/dj5ZnEtNAsqj2vtXw/mIebOSzES4aT6BV+4qT3F8RHGJJLV3ssiNlCkvnT5V Xqq7e9kgNEG1pqzH5bhxtnPcG6qH7X2kM3Dzz8bFf90SJ3YLYX/RO49pQV3CTr5AqoVL LNdcJ0qIWsE5CLNjCtSlRk02TFA/D641DuCzppLZR6O51p1PNHK6LvU8Na+WYc8fz3KS 9Ov7FoivT6EbbhZWvEUsIA87/2ds3H46wBEU4ULDUeMY32YRjMfrwOhgli1FFZegip7a uRCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=CXiwyxpsYbtktJw1JiQrFKlxs5Eu1bgqDSTeXz8tQMY=; b=DRFg6lrTvEKExyyxjUdzowBuxAzgn5eu23RRKUlAGZoZ6TGfZ7PoVdGIvbdYDS3Rp6 PJq2d4XdffJHJUMMHdIo7uqswxDuKFVy4rAhjlkYoGpAAl+5HSjhBAglRNgLRZic4iZ8 P6Qb74w/bUVoTGtw3ekXsM+A5BTIG/60xGZvgb7zcgK5OtXwqi17nuiYYiWiu7KqQqUG 2MybcZnZmbQlbZgtmOTrJfLO1EKtDV9qSPlktcIsggISCHh/AZ7yL/fvTXGLxI9kYQXW SA6f3SkR2ep595A6WhFP6+ISxlqFbcNkk0h7OhGYvHOlU7GURrHbZgxapFhXIs8e032d loUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of steven.price@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steven.price@arm.com Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id m27si460642eja.92.2019.02.21.03.35.27 for ; Thu, 21 Feb 2019 03:35:28 -0800 (PST) Received-SPF: pass (google.com: domain of steven.price@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of steven.price@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=steven.price@arm.com 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 0263315AB; Thu, 21 Feb 2019 03:35:27 -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 75F723F5C1; Thu, 21 Feb 2019 03:35:23 -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?b?SsOpcsO0bWUgR2xpc3Nl?= , 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 v2 03/13] mm: Add generic p?d_large() macros Date: Thu, 21 Feb 2019 11:34:52 +0000 Message-Id: <20190221113502.54153-4-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190221113502.54153-1-steven.price@arm.com> References: <20190221113502.54153-1-steven.price@arm.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: James Morse 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, provided a does nothing default. Signed-off-by: James Morse Signed-off-by: Steven Price Acked-by: Mark Rutland --- 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 */