Commit 79d02189 authored by Huacai Chen's avatar Huacai Chen Committed by Greg Kroah-Hartman

MIPS: Ensure pmd_present() returns false after pmd_mknotpresent()

commit 92aa0718c9fa5160ad2f0e7b5bffb52f1ea1e51a upstream.

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

References: 5bb1cc0f ("arm64: Ensure pmd_present() returns false after pmd_mknotpresent()")
Reviewed-by: default avatarJames Hogan <>
Signed-off-by: default avatarHuacai Chen <>
Signed-off-by: default avatarPaul Burton <>
Cc: Ralf Baechle <>
Cc: James Hogan <>
Cc: Steven J . Hill <>
Cc: Fuxin Zhang <>
Cc: Zhangjin Wu <>
Cc: <> # 3.8+
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent c2b02f92
......@@ -189,6 +189,11 @@ static inline int pmd_bad(pmd_t pmd)
static inline int pmd_present(pmd_t pmd)
if (unlikely(pmd_val(pmd) & _PAGE_HUGE))
return pmd_val(pmd) & _PAGE_PRESENT;
return pmd_val(pmd) != (unsigned long) invalid_pte_table;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment