Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3123689ybg; Thu, 24 Oct 2019 22:33:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqysMEddtJDMn1KaVVzabxXyIn1UttvGiXufKY63+t623aW7ceLRXX01tD+n5TNlyxdHqpSH X-Received: by 2002:a17:906:f1c5:: with SMTP id gx5mr1627985ejb.314.1571981633973; Thu, 24 Oct 2019 22:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571981633; cv=none; d=google.com; s=arc-20160816; b=JneJHIOW364ZVUXLVD6nQlaMw+Ilb3Z8azkH+TWOVfjuHg/qFLyZ6C218jHs9yFuTI wRgkdPUKsnO4gT66DBroB0UL2P3AREHpd1489XMp+be2cCYbDILg1bkNGF5aTf2VNABA hQX6f2rkTa8yMJSrxMloKJ9Ag9xC5D4gFjCEzoFH5Cqwl/OFdwVKNk5x89Dic/4bmyZZ MfzlVBmTecwyGwqFmiR655OHEAUx6Ywl4BY5lJ40oa6rR0vTng2CGpWPup3rDmyP/5gj 4yIxUCZlW0nHigy8Wy5vqdiJCDOWL3/paqMoQ1lMOwZBbb91yGYHlO3mUf6tho0iHdAQ s9pg== 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=2ZWHYWG0m4GIxrX2QJnU01JP3Rg3HlhGBlX72neJenA=; b=grqr/qeQjb3midJ5RgdZ7Ra4ziS/jof5xH+zEEl4ndeEs7fGvPDEzaSGK6F96QSdXd 7rNJafTB46/UaLFel+fStw39M65Sbe7a49VIlgzXdolMjRTR4I6aPMDA4+lNNZ8VfXsv 2cHqjq4SgXlWbltyfACAFx2d6miuyJilzuCL8J+vjnIdP0chk6Ff481xDXA09dKtadQf xQj/+6pc0v3sxyjXM2m+fiSrFr91vtwfE9TTgU/KEKol/YBn14NL9oRIguicn7ssph1b DVWYJ5/FTBYBoZ6Jw+/YPg7UXvjudAAxUs+DFnXzu/+X0w0H4CjmTUHj7t1QY7La6VAV 4/PA== 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 49si566342edz.9.2019.10.24.22.33.30; Thu, 24 Oct 2019 22:33:53 -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 S2438567AbfJXJhu (ORCPT + 99 others); Thu, 24 Oct 2019 05:37:50 -0400 Received: from foss.arm.com ([217.140.110.172]:44330 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438561AbfJXJht (ORCPT ); Thu, 24 Oct 2019 05:37:49 -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 D919A337; Thu, 24 Oct 2019 02:37:33 -0700 (PDT) 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 186B13F71F; Thu, 24 Oct 2019 02:37:30 -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 v13 02/22] arc: mm: Add p?d_leaf() definitions Date: Thu, 24 Oct 2019 10:36:56 +0100 Message-Id: <20191024093716.49420-3-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191024093716.49420-1-steven.price@arm.com> References: <20191024093716.49420-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 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