Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6127113ybi; Wed, 31 Jul 2019 08:47:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2P20+2ENqyR9sws9eBIOr6gb0AXYj67WmQHAGJzploAaZ3RpxkvEj4l0JiiDkeKT+u+HC X-Received: by 2002:a17:90a:b394:: with SMTP id e20mr3624565pjr.76.1564588037420; Wed, 31 Jul 2019 08:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564588037; cv=none; d=google.com; s=arc-20160816; b=svCw7DJlQRkP7H1Pj4dElsWs7HY1uR5r3dKkdsgQpDSSxeSKqWzI8lmpvnjEaRr1t/ KiK+XtaN0XrSWzZLH/3ki1mN/A2lHZSw28XMfAoz/FQ87Ht2nW8cEtYuKHn48z6S3Qhi buNe+G9dqHKkgxAdOXcvwWEnIvWiN+RpSvf/hjAbYqKTwFbO8ZEfAq6TC/VY/xIry1Xg ZzHTGSEc8JnfavJDNNTRue44vZPJKtb1PUbHKWK3wLrCEB8WpfYveUIouwdSDkcpykG/ /zyPaZYLlCleZFwZjnkUR50SywaUE3N6laD1b40eW7UydQrgKjNL/txihwKAQo3q8cW0 +gHw== 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=tw4JZILHpRw8yw2ivWns3JMulA885A2eTY+XMl6s8Qw=; b=w2p0r/dGGquna3QMG+D5tDS3OfMQVl3Wvhxn1gsSTrajNdnpq7orYUCDSO0KYyXMTf VTYH/KsllDK0sy581+iG2/vUQiXbxmwVPh0ZF2gxQTCgA68KWDCX1zJBOKiRyUkCSibO WAoeL4ZmDDDd7TnkLzw9w+V1zMTcKdrFtpt8YwX5FMtvrh1osfoO50rYUbD7wd/3yJzs p320yUc7DjJdQ7rr+ITMgz/aByZCxPDsePW8idNYZo3rDjlJiQN2OUC5g32Zz+hhrPe4 Tw4EoLm1gm6mXpBLhjxRx0jW9T2wu7irnQ7W7hwqqvgLi8lvpI1xvmdqeeWug1Qh9064 8KyQ== 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 x7si32365517plv.130.2019.07.31.08.47.01; Wed, 31 Jul 2019 08:47:17 -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 S1729567AbfGaPqU (ORCPT + 99 others); Wed, 31 Jul 2019 11:46:20 -0400 Received: from foss.arm.com ([217.140.110.172]:49514 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726962AbfGaPqS (ORCPT ); Wed, 31 Jul 2019 11:46:18 -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 8040E1576; Wed, 31 Jul 2019 08:46:17 -0700 (PDT) Received: from e112269-lin.arm.com (e112269-lin.cambridge.arm.com [10.1.196.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B52053F694; Wed, 31 Jul 2019 08:46:14 -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 v10 02/22] arc: mm: Add p?d_leaf() definitions Date: Wed, 31 Jul 2019 16:45:43 +0100 Message-Id: <20190731154603.41797-3-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190731154603.41797-1-steven.price@arm.com> References: <20190731154603.41797-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 1d87c18a2976..8c425cf796db 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