MIPS: Ensure pmd_present() returns false after pmd_mknotpresent()
[platform/kernel/linux-starfive.git] / arch / mips / include / asm / pgtable-64.h
index 0036ea0..93a9dce 100644 (file)
@@ -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;
 }