linux-mips
[Top] [All Lists]

[PATCH 3.18 28/47] MIPS: Ensure pmd_present() returns false after pmd_mk

To: linux-kernel@vger.kernel.org
Subject: [PATCH 3.18 28/47] MIPS: Ensure pmd_present() returns false after pmd_mknotpresent()
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Fri, 11 Jan 2019 15:08:13 +0100
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, James Hogan <jhogan@kernel.org>, Huacai Chen <chenhc@lemote.com>, Paul Burton <paul.burton@mips.com>, Ralf Baechle <ralf@linux-mips.org>, James Hogan <james.hogan@mips.com>, "Steven J . Hill" <Steven.Hill@cavium.com>, linux-mips@linux-mips.org, Fuxin Zhang <zhangfx@lemote.com>, Zhangjin Wu <wuzhangjin@gmail.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547216115; bh=21PnQIyCanr20JrZ6oVVADLWkIBKOgHEnYAw8AbjNuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w6/KIMf53bbTZE/mVQIcpVGaMM3Gl6bkSXl1V4Ah/q6BJCU8rEcaZuU09I23f1D0u 4LHgibTOhcFUmU914lbud47ghN25IoqXDfVoPfYsIVOcOiJOqihMJ+iphJPv1+Ab7E zv2UjrYgRrj/bbHmynxctdFl6+c7RcTIR4jfBG80=
In-reply-to: <20190111130956.170952125@linuxfoundation.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20190111130956.170952125@linuxfoundation.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: quilt/0.65
3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Huacai Chen <chenhc@lemote.com>

commit 92aa0718c9fa5160ad2f0e7b5bffb52f1ea1e51a upstream.

This patch is borrowed from ARM64 to ensure pmd_present() returns false
after pmd_mknotpresent(). This is needed for THP.

References: 5bb1cc0ff9a6 ("arm64: Ensure pmd_present() returns false after 
pmd_mknotpresent()")
Reviewed-by: James Hogan <jhogan@kernel.org>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/21135/
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <james.hogan@mips.com>
Cc: Steven J . Hill <Steven.Hill@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: <stable@vger.kernel.org> # 3.8+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/include/asm/pgtable-64.h |    5 +++++
 1 file changed, 5 insertions(+)

--- a/arch/mips/include/asm/pgtable-64.h
+++ b/arch/mips/include/asm/pgtable-64.h
@@ -189,6 +189,11 @@ static inline int pmd_bad(pmd_t pmd)
 
 static inline int pmd_present(pmd_t pmd)
 {
+#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
+       if (unlikely(pmd_val(pmd) & _PAGE_HUGE))
+               return pmd_val(pmd) & _PAGE_PRESENT;
+#endif
+
        return pmd_val(pmd) != (unsigned long) invalid_pte_table;
 }
 



<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 3.18 28/47] MIPS: Ensure pmd_present() returns false after pmd_mknotpresent(), Greg Kroah-Hartman <=