Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4453350ybp; Mon, 7 Oct 2019 08:39:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQqSQcZYGlKLuJNZNOcz/fK4Tmjl3bVdnszwa5hm+f1skD6P1Pka1mQXrEGBujZQLkLNHn X-Received: by 2002:a50:ed8e:: with SMTP id h14mr29466846edr.69.1570462769262; Mon, 07 Oct 2019 08:39:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570462769; cv=none; d=google.com; s=arc-20160816; b=mDypbW47EVuWAcqw9N3gKJrzIW+gCXgvaaZdGhIX3TaMg/XKB7f+QWbq2Sty/5C6vq c3yZ2uQdFX2kpfR/qed7zeF1BVrvBwhq4IGixOp0ScBaKj67LVG2Ihz8clPuTDe541Sf P1uyrzHncpcWTNn3oDI1XLizvhGdnTejIEql5u/WYl84ae4X+aNkVTF+r1sKv6DGlK+D 5qypPrZMfvAVEffo7aiTwrxiK4Sd+wJU6oF1VrD39wF4btyDOmzxUEkS4QccWRhMScNK pttMNL/Ssmmh/vtbP5Ts/CbJDpHayO/1FEL9etwwEHVrV5bliWBrtOapE9RvrkbY5Xpf e9yw== 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=totNucHESMrUL3XYLwC6cWLhLdqXfNPfvlH+fNlpZMM=; b=UIPLDeUYUc/UaUY29b8EvJoAZWG9wh2f5DT3EjWTrGLGfd3f3NNj9KROiaeUIARrFc Z7bC2kbUS0v9BrWIY6D+vXfY9kza457Qy5ESUTVipxu4ZEzMLSwRxZJeB42hZxtLkvkr Q4RUXNYDoGHsx8fauntKFyyMjDLgNLV7LmVUax5ESFHSMkseevidB0b+gxwNDKji2gjz qfVVuc0vm3aDqBzbzZ3ACVn0FpAjH4D9co3agxaF1a6ogF0T+TIt9zOWr4tZRtxLdhLv gcBFr+MMTO1xCB/kBGfeTHVNSL2M1IXg3+AjoEAQ2Q+fvGsAAoxwtJQOltLNWL1Yrv48 wO9g== 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 z55si9108223edz.254.2019.10.07.08.39.06; Mon, 07 Oct 2019 08:39:29 -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 S1728688AbfJGPis (ORCPT + 99 others); Mon, 7 Oct 2019 11:38:48 -0400 Received: from foss.arm.com ([217.140.110.172]:38250 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727745AbfJGPir (ORCPT ); Mon, 7 Oct 2019 11:38:47 -0400 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 3DF3515AB; Mon, 7 Oct 2019 08:38:47 -0700 (PDT) Received: from e112269-lin.arm.com (unknown [10.1.197.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 71D2F3F6C4; Mon, 7 Oct 2019 08:38:44 -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 , Vineet Gupta , linux-snps-arc@lists.infradead.org Subject: [PATCH v11 02/22] arc: mm: Add p?d_leaf() definitions Date: Mon, 7 Oct 2019 16:38:02 +0100 Message-Id: <20191007153822.16518-3-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191007153822.16518-1-steven.price@arm.com> References: <20191007153822.16518-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 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 7addd0301c51..5ec798e50836 100644 --- a/arch/arc/include/asm/pgtable.h +++ b/arch/arc/include/asm/pgtable.h @@ -274,6 +274,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(pmd) & _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