Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8256374imu; Fri, 28 Dec 2018 13:53:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN5iOG0Mx3ynG3A1nXE1/qL7qU4g8o8/1eKgSzlb27OlXcw5XYMqoT7w7LJkhU3QkO0Wmdog X-Received: by 2002:a17:902:5a86:: with SMTP id r6mr27998799pli.301.1546033994482; Fri, 28 Dec 2018 13:53:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546033994; cv=none; d=google.com; s=arc-20160816; b=txsFGB5iAnt2c6dKvska0/gvmUgwyljjdI+2svO/5kkj7xfczWi/YAV23M1k9XBRIe WdHnb3GdTit57nEFB0mzuMAzKSe95C3dFa7sl8sulx5VWDfHLiyvNNhya2HoHanXT1+4 Xx+N71eq8dLO2GoETQTcx5aDL1GFUU3348IqOa1MEExapsVDLTcsysw4DdMjaNQF1IxW i+X3pTU1A//B3m3KAueAXcv+fPAhCFck9lsVFHCjFc1mCiZnatm3K3W+WPxCB+po/jey 6n2y6i8PfyI1u57FLsHrh5m5wZVzr/RUxAlfmSjXbnqnZIqyy8kXRD4nEkKPirR2zEDY dkeA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VvBrxAxI3mIyfeeXO28U5mSBKvWOYwQlprFRWckz2hA=; b=E/OY2fyobF7wCRy5rbD8ecGxnllrFIOqZdHVmSXlbqFrau6S9y8AllxEHSM+IlD2sO ZcSgn+/MtvO7Xz/GzEp5WZgAk9/oNNhvn816ZOL5wnXpYmBnWesFQdQepEtVgG5rJgu+ a55ah4XKKVE+UWfgZSVa3abiALg09hFbfioZTKTPe9BtFfUs+vCC7q1buj9Szn/ZmNaG Q2YpBhnhjR8sqWHb6eqT7VhvGaj0ddRGStlWbLtfaS2HGenAgQqgq0idnszPIK7NF49S 6jmMydiQzO1nEqiVvSkv2WZ2Nj48TwG89XnWNlsT6HaL6z69E9/hmd2CnWEdLrrn3CBQ bvpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IMS8cW28; 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 s12si1516822pgh.395.2018.12.28.13.52.59; Fri, 28 Dec 2018 13:53:14 -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; dkim=pass header.i=@kernel.org header.s=default header.b=IMS8cW28; 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 S1731292AbeL1MOo (ORCPT + 99 others); Fri, 28 Dec 2018 07:14:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:33584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731113AbeL1MOj (ORCPT ); Fri, 28 Dec 2018 07:14:39 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B100C20866; Fri, 28 Dec 2018 12:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545999279; bh=Qjfn1vFeDBCqlf/QEnd2BYQyAq36nZsOCznt3wXd5HE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IMS8cW28rwJ30qE4ImyP3syXlwHyP20a9NEn3nV7ucN0D4JJ4rhRhyaG53KdALFML r2f5GnAroDYH5L9Vs5ZgCS4K8emd/WQvuO/iX0OV8c5bv7RV4V/84JZbIhXVYc0fpT Ppxuq77jwna3Ff8aE1oe7w30H4f0+fVBxSChH2M0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Kirill A. Shutemov" , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.19 33/46] mm: introduce mm_[p4d|pud|pmd]_folded Date: Fri, 28 Dec 2018 12:52:27 +0100 Message-Id: <20181228113126.764275627@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181228113124.971620049@linuxfoundation.org> References: <20181228113124.971620049@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 88ebc6102c7c..15fd0277ffa6 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -1127,4 +1127,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.19.1