Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp760937ybl; Fri, 6 Dec 2019 05:54:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwhAO76X3dio34+UCncyWSpfzZJQ5wGp5rqY+JMTeE4PY0kgLbOvE2rMdk00O7uzASRrug3 X-Received: by 2002:a9d:5cca:: with SMTP id r10mr10227082oti.57.1575640476600; Fri, 06 Dec 2019 05:54:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575640476; cv=none; d=google.com; s=arc-20160816; b=LKA4rCuTW6ZnAxwTe/bIA6ZJ4EQi7kYQX3kLQvMm9QJADr9egE92e8wTitoS+aupFh 3hq7zUJKrh9K3NdlsXfP2X98GVdgzmLWRJmnFPJ3NfIgfam1YpEnkfInq85XiI72yFoq doLTJ6DbUC6ObZbKhfmTjgZ9PpNWyhAFdZObVWEY4Tp9x0Y1DF3cSyUdArqeFupzo7la NEOGFZ2Wo3b/A2tlN7lN+glcjuMW0tayRKKiF2GwI3RPBJWqxm84Z9G/udzxMrGKtmio eHlVvIIZysBOxMkAc0gfbQdOnXs3tcp8IyHLMzPoGFzPEPZv9YH1LjmH+aNpsHCjn807 Xj5w== 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=e9kVfwIUAFNYAfGo+UPHYCGTX8aUSwjW+DSiUMIQbUs=; b=CiV2CjdZAuwNCbT3Y4OJIHDGyFif/5c/soybUZfYCtHUfQhNnX8dMwsTiCYV9y67Ta OqYVnndVTQGxw+vyYySWQgJvUz6cZl1YOJzWxGxtk+8G94VL5k/jCrda6OiXdW5Bp3MQ wo6XGPukeff4nPMVmVH8i7Fsr3FRQWRC3DXP3Amx4rmt4OUpBbnNFgRvSH//G+jHHuxd l+k//0URq+FyPi6sSHqD50V1vdHuIR3ls9F+hQNnjw3trp3l2Mve0YA2Cfl3IRvk2yrP Gq3Gt/f6Fr0dPLgZ07lf57jQYCXQIeb77FZE0bf3H3P2iUrj6hjU/DSdFXR2tW4nlMYr FrSQ== 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 d23si5971854oti.158.2019.12.06.05.54.24; Fri, 06 Dec 2019 05:54:36 -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; 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 S1726413AbfLFNxu (ORCPT + 99 others); Fri, 6 Dec 2019 08:53:50 -0500 Received: from foss.arm.com ([217.140.110.172]:44396 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726395AbfLFNxt (ORCPT ); Fri, 6 Dec 2019 08:53:49 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C512211D4; Fri, 6 Dec 2019 05:53:48 -0800 (PST) Received: from e112269-lin.cambridge.arm.com (e112269-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0C07F3F718; Fri, 6 Dec 2019 05:53:45 -0800 (PST) From: Steven Price To: Andrew Morton , 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" , Vineet Gupta , linux-snps-arc@lists.infradead.org Subject: [PATCH v16 02/25] arc: mm: Add p?d_leaf() definitions Date: Fri, 6 Dec 2019 13:52:53 +0000 Message-Id: <20191206135316.47703-3-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206135316.47703-1-steven.price@arm.com> References: <20191206135316.47703-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 walk_page_range() is going to be allowed to walk page tables other than those of user space. For this it needs to know when it has reached a 'leaf' entry in the page tables. This information will be provided by the p?d_leaf() functions/macros. For arc, we only have two levels, so only pmd_leaf() is needed. CC: Vineet Gupta CC: linux-snps-arc@lists.infradead.org Acked-by: Vineet Gupta Signed-off-by: Steven Price --- arch/arc/include/asm/pgtable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h index 9019ed9f9c94..12be7e1b7cc0 100644 --- a/arch/arc/include/asm/pgtable.h +++ b/arch/arc/include/asm/pgtable.h @@ -273,6 +273,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep) #define pmd_none(x) (!pmd_val(x)) #define pmd_bad(x) ((pmd_val(x) & ~PAGE_MASK)) #define pmd_present(x) (pmd_val(x)) +#define pmd_leaf(x) (pmd_val(x) & _PAGE_HW_SZ) #define pmd_clear(xp) do { pmd_val(*(xp)) = 0; } while (0) #define pte_page(pte) pfn_to_page(pte_pfn(pte)) -- 2.20.1