linux-mips
[Top] [All Lists]

[PATCH 4.20 122/145] MIPS: Ensure pmd_present() returns false after pmd_

To: linux-kernel@vger.kernel.org
Subject: [PATCH 4.20 122/145] MIPS: Ensure pmd_present() returns false after pmd_mknotpresent()
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Mon, 7 Jan 2019 13:32:39 +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=1546865029; bh=euNqL8mKejZl8hBoCmPXRqnaINEt9YnhRXpnWvYQPqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fq1g8U8Vsco+xQQgrchRuKgQ5vbyKW3l/RasVriCDTINO9cME2DsMvRG6W0JFqWDU xzfU6LjcPwJ58+OQEZrmjFfXd41nUkqakbCtvbTG+QjStyK+p62FelnCPW7MbSWXr6 J69kpeQ91oGavgNlLyCEX2h0d3+aWcPoiap/tQHc=
In-reply-to: <20190107104437.308206189@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: <20190107104437.308206189@linuxfoundation.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: quilt/0.65
4.20-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
@@ -265,6 +265,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 4.20 122/145] MIPS: Ensure pmd_present() returns false after pmd_mknotpresent(), Greg Kroah-Hartman <=