Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp2020165img; Wed, 27 Feb 2019 09:08:44 -0800 (PST) X-Google-Smtp-Source: AHgI3IaLVRtPy0kYiUUVFLyGVCBeL1aDxbEclWJaDy4EZ+B0GAu0G7WH8f5GfoHHhwphv0JcMW7w X-Received: by 2002:a17:902:1347:: with SMTP id r7mr3201775ple.82.1551287324562; Wed, 27 Feb 2019 09:08:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551287324; cv=none; d=google.com; s=arc-20160816; b=k5LTIFMSAB/Dem202y2suQSPdV0BuQRKpkIoAA23ELRHmSQ3r4p4+2TtQDnTmhO/Wc 7qkl6WUMXTE9LoawwT3VRH7jz0s/n+9Td5667Fy5HgEVUWrpC70UibgArUUB+pzhD6jt pO1tjMC7T3id8c5s5CofQuzHz8yxWhj6iwZ9KV1XDXCVTVVzwrZOBR/UWkoxev12Qy3P uFV5EWuoqgn+zovvRYttLaKa/2i04Cc5XPxC/rjpjvzoEKv1kbaRAl4ZRKCwgwLfU3f6 IjAV0FfA4yiOSDuOwxgkQ0aKtRU10mFYrnUDXcx6kS4aqwgfRjdZQpeTc/hTjY9a6+nN RgnQ== 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=ZR8Pi3jJ1KIw24YeuZCSXA+UGKblSCif1NtzpVDNSOM=; b=Bic40a2Asd1Gl5201az3KlvToMIz80dF0P+CUW/Ua0A6vlbURTck/964HtXpdduQM+ 2A0BTGzHwKjkANYrTb2OIHN0RlNyQbIMKeaSRR+9b8kFPflPteRWRR70u2KllPC2g7wG 7P/iiNt7Hu1XUuJxmwQnSKRu23xwVwIuxuuMxnCTiQyb4dhEa40DckeDdVixxeOmtAUj 5xnQQvLUl1go8robsPSJQjrMH5aFPRFcgti+PIjwbXFYi1IQihOvOJjCqrYUsnJQ5mSm 7UBC3eH9Gw373ujihltjNMyk4RF0Xqxx4yHtXZTEeuHVmODTqXvml8jpu4/G9kBUhBDd 9nJQ== 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 s139si9941682pgs.405.2019.02.27.09.08.29; Wed, 27 Feb 2019 09:08:44 -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 S1730240AbfB0RHM (ORCPT + 99 others); Wed, 27 Feb 2019 12:07:12 -0500 Received: from foss.arm.com ([217.140.101.70]:36108 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729981AbfB0RHK (ORCPT ); Wed, 27 Feb 2019 12:07:10 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EC55B16A3; Wed, 27 Feb 2019 09:07:09 -0800 (PST) Received: from e112269-lin.arm.com (e112269-lin.cambridge.arm.com [10.1.196.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 240003F738; Wed, 27 Feb 2019 09:07:06 -0800 (PST) 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" , Ralf Baechle , Paul Burton , James Hogan , linux-mips@vger.kernel.org Subject: [PATCH v3 11/34] mips: mm: Add p?d_large() definitions Date: Wed, 27 Feb 2019 17:05:45 +0000 Message-Id: <20190227170608.27963-12-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190227170608.27963-1-steven.price@arm.com> References: <20190227170608.27963-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 is provided by the p?d_large() functions/macros. For mips, we don't support large pages on 32 bit so add stubs returning 0. For 64 bit look for _PAGE_HUGE flag being set. This means exposing the flag when !CONFIG_MIPS_HUGE_TLB_SUPPORT. CC: Ralf Baechle CC: Paul Burton CC: James Hogan CC: linux-mips@vger.kernel.org Signed-off-by: Steven Price --- arch/mips/include/asm/pgtable-32.h | 5 +++++ arch/mips/include/asm/pgtable-64.h | 15 +++++++++++++++ arch/mips/include/asm/pgtable-bits.h | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/mips/include/asm/pgtable-32.h b/arch/mips/include/asm/pgtable-32.h index 74afe8c76bdd..58cab62d768b 100644 --- a/arch/mips/include/asm/pgtable-32.h +++ b/arch/mips/include/asm/pgtable-32.h @@ -104,6 +104,11 @@ static inline int pmd_present(pmd_t pmd) return pmd_val(pmd) != (unsigned long) invalid_pte_table; } +static inline int pmd_large(pmd_t pmd) +{ + return 0; +} + static inline void pmd_clear(pmd_t *pmdp) { pmd_val(*pmdp) = ((unsigned long) invalid_pte_table); diff --git a/arch/mips/include/asm/pgtable-64.h b/arch/mips/include/asm/pgtable-64.h index 93a9dce31f25..981930e1f843 100644 --- a/arch/mips/include/asm/pgtable-64.h +++ b/arch/mips/include/asm/pgtable-64.h @@ -204,6 +204,11 @@ static inline int pgd_present(pgd_t pgd) return pgd_val(pgd) != (unsigned long)invalid_pud_table; } +static inline int pgd_large(pgd_t pgd) +{ + return 0; +} + static inline void pgd_clear(pgd_t *pgdp) { pgd_val(*pgdp) = (unsigned long)invalid_pud_table; @@ -273,6 +278,11 @@ static inline int pmd_present(pmd_t pmd) return pmd_val(pmd) != (unsigned long) invalid_pte_table; } +static inline int pmd_large(pmd_t pmd) +{ + return (pmd_val(pmd) & _PAGE_HUGE) != 0; +} + static inline void pmd_clear(pmd_t *pmdp) { pmd_val(*pmdp) = ((unsigned long) invalid_pte_table); @@ -297,6 +307,11 @@ static inline int pud_present(pud_t pud) return pud_val(pud) != (unsigned long) invalid_pmd_table; } +static inline int pud_large(pud_t pud) +{ + return (pud_val(pud) & _PAGE_HUGE) != 0; +} + static inline void pud_clear(pud_t *pudp) { pud_val(*pudp) = ((unsigned long) invalid_pmd_table); diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h index f88a48cd68b2..5ab296dee8fa 100644 --- a/arch/mips/include/asm/pgtable-bits.h +++ b/arch/mips/include/asm/pgtable-bits.h @@ -132,7 +132,7 @@ enum pgtable_bits { #define _PAGE_WRITE (1 << _PAGE_WRITE_SHIFT) #define _PAGE_ACCESSED (1 << _PAGE_ACCESSED_SHIFT) #define _PAGE_MODIFIED (1 << _PAGE_MODIFIED_SHIFT) -#if defined(CONFIG_64BIT) && defined(CONFIG_MIPS_HUGE_TLB_SUPPORT) +#if defined(CONFIG_64BIT) # define _PAGE_HUGE (1 << _PAGE_HUGE_SHIFT) #endif -- 2.20.1