Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1728088ybg; Sat, 19 Oct 2019 01:12:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLd/Tqrv1nMaOmMyl51iwdLo0kVSMHzV0Gy8Tb8pYxC93nr5MKmppNCbVQvPqjo4pJuyve X-Received: by 2002:a50:ed01:: with SMTP id j1mr14028923eds.111.1571472758088; Sat, 19 Oct 2019 01:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571472758; cv=none; d=google.com; s=arc-20160816; b=jD+8FseV0OPkHq8/yTWxRQjv9kFm/qOIln+xqS+CQ4HvmZGHOWyIWaKrugpZsE3NOE lSteI8rfhosnhDL3gmf395puJS7tv3fZ6ibeWL9so+X9N2EaV+huNYJ2l2O4qOGrNagP bRn2NN5Y+I6VrI/D7i+4jkbzSpXA27qHYmwaLFuiGHPS5FStZ4yClqzc/7HccMPpDVtN kX2HR/L6Rsv6IJCWpRuSr7+tg/ZVVxOSo5SyuQpHLEsUw0kRg0nh0xiQVx9yApKBxaiP dc6nMYjgJTjXm4j7KobkjxYx+tYz5+voNWHLLI0DPK07h5wFd6Nboz/N9TQVbux9Yzfg kLKw== 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=dVFFK+fnz4DQxleY035U3kHY5ihLJFWfnMVSkYGqIZBKTtSqVy2vS2cguiG05slL+S 7gENrB/t/sADUq72QdaIUzytz/dkkvNaEv0BVmoEM9oK2L0XZ7dlPIBKMh8imNJOoNLH 30iiDlI1ox95p+YERhS/U5OxEP+icmtK5F/CN5z0GQPAnWBnO2C9cZBEWaKV+DxrOJT4 1R2C67xImYSOIqArcWVUvs/LXVMgIXwLZ0u8mhiujnvuKKNI/NfhQdG7+XpEfxige0Qy y+77kLff1PHZCXMEjvaUfyOHEI20ha0/3xSdVtMpor2VzSgaGrM6xYt8vLHI4ccnKdf3 e4Ng== 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 n6si5087506eju.100.2019.10.19.01.12.15; Sat, 19 Oct 2019 01:12:38 -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 S2633348AbfJRKNc (ORCPT + 99 others); Fri, 18 Oct 2019 06:13:32 -0400 Received: from [217.140.110.172] ([217.140.110.172]:60828 "EHLO foss.arm.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S2633333AbfJRKNa (ORCPT ); Fri, 18 Oct 2019 06:13:30 -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 AD7194A7; Fri, 18 Oct 2019 03:13:06 -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 D2BF23F6C4; Fri, 18 Oct 2019 03:13:03 -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 v12 02/22] arc: mm: Add p?d_leaf() definitions Date: Fri, 18 Oct 2019 11:12:28 +0100 Message-Id: <20191018101248.33727-3-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191018101248.33727-1-steven.price@arm.com> References: <20191018101248.33727-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