Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3341501yba; Mon, 6 May 2019 22:51:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwURJBkn8bRxW34OdVCiEjdvoWVIudxRQXKjQm6ZMVW1buBJyye2KXpPrqcg8HBVtoAzeTD X-Received: by 2002:aa7:8289:: with SMTP id s9mr1012365pfm.208.1557208260347; Mon, 06 May 2019 22:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557208260; cv=none; d=google.com; s=arc-20160816; b=01aYfRaDDjZ8W4K6pwiF/udx725AOHH4TJg+UIRwYlr/FjFjqfAjpTZncoaGHwIUuY aTUq/Ne7Bd4KFlwsLFRfkJD3jAjp/hPJrM4MZ53eKEkFFZHWcyfj6cw3w79WRaE5mBSI Qi1XCe15rVPM0iDRnr2VpHNTWsnAA6CbL3EjIuX5NSc4vZPubSY8hIVXJ7fxytckU0U7 CteMZbfJpPchu86rzTAGIMHTWw9p6jRf4jROq6ZCPY3I9fH+4dJ5ZdQro/4L7LPihWLy 8Y+VVh87yN6F69Z3VXL/YT9wKZzZS9xFb6j4Xhd7UkwrKnQ++X4ydkZCv5bKPMFEJb4B CzkQ== 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 :dkim-signature; bh=RnQG3gWBnCsxqDJcn8/oZsOyN6sRS9SJtgFnENdECEM=; b=KMZt1J3JYFgp5qDZ5ueE/ZUJfn+S87b2pS8xXIe+oGy3FJL3O7VHZpGPt0ZiUAYoP+ LKwxpBQPqfLvAn+zRQcnp8ddT603LzCykJVYi+qqw30yJa6y0UXjRxB5ZF5qOH3iuXcM UXVxp0JwDZ9SBgehWtZMo/b+y/U3i70vAJjMa64Y42BVVB5L7SRuaW4Cyt8d/ttjV0sc HeiciU6w8gjgnERboC8HVqT5Kngkhlws3kdSxch35DnH5v2OMrorNQtiZBAQWq32U0ot VvgGdyx1NYKOGwW6DlEANue7DBhBTcr3s32E+A62t/YeTA2Jvn8jTszVItEwVpC+iM50 3OPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iw+taorb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j8si18604608pfr.47.2019.05.06.22.50.45; Mon, 06 May 2019 22:51:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=iw+taorb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729096AbfEGFt5 (ORCPT + 99 others); Tue, 7 May 2019 01:49:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:59830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729086AbfEGFkT (ORCPT ); Tue, 7 May 2019 01:40:19 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9F28E214AE; Tue, 7 May 2019 05:40:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557207619; bh=uhf7mZGFe92exMx09nG6PaA1Xh8RhBtl/QjxrNyARJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iw+taorbqtCKK3s8qMe2teskLUgASYK6AHJQPB4E0qIVMYBdwuGeIDX3eYi7KB8YD hGupHsWbdavvnZRvLTUtGyYywJVGLV3OZ+5K7qD4cG1l65ECozaWUC/xPltCMS30An I6t1id15RLKZ3cF2q0gi/dsrhlBonmFfv7H6cLQc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Martin Schwidefsky , "Kirill A . Shutemov" , Sasha Levin , linux-arch@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 61/95] mm: introduce mm_[p4d|pud|pmd]_folded Date: Tue, 7 May 2019 01:37:50 -0400 Message-Id: <20190507053826.31622-61-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190507053826.31622-1-sashal@kernel.org> References: <20190507053826.31622-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Schwidefsky [ Upstream commit 1071fc5779d9846fec56a4ff6089ab08cac1ab72 ] Add three architecture overrideable functions to test if the p4d, pud, or pmd layer of a page table is folded or not. Acked-by: Kirill A. Shutemov Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin --- include/asm-generic/pgtable.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index f00421dfacbd..0c21014a38f2 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -1081,4 +1081,20 @@ static inline bool arch_has_pfn_modify_check(void) #endif #endif +/* + * On some architectures it depends on the mm if the p4d/pud or pmd + * layer of the page table hierarchy is folded or not. + */ +#ifndef mm_p4d_folded +#define mm_p4d_folded(mm) __is_defined(__PAGETABLE_P4D_FOLDED) +#endif + +#ifndef mm_pud_folded +#define mm_pud_folded(mm) __is_defined(__PAGETABLE_PUD_FOLDED) +#endif + +#ifndef mm_pmd_folded +#define mm_pmd_folded(mm) __is_defined(__PAGETABLE_PMD_FOLDED) +#endif + #endif /* _ASM_GENERIC_PGTABLE_H */ -- 2.20.1