Skip to content

Commit 141682f

Browse files
sunnanyongpalmer-dabbelt
authored andcommitted
riscv: mm: make pmd_bad() check leaf condition
In the definition in Documentation/vm/arch_pgtable_helpers.rst, pmd_bad() means test a non-table mapped PMD, so it should also return true when it is a leaf page. Signed-off-by: Nanyong Sun <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent f5397c3 commit 141682f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static inline int pmd_none(pmd_t pmd)
184184

185185
static inline int pmd_bad(pmd_t pmd)
186186
{
187-
return !pmd_present(pmd);
187+
return !pmd_present(pmd) || (pmd_val(pmd) & _PAGE_LEAF);
188188
}
189189

190190
#define pmd_leaf pmd_leaf

0 commit comments

Comments
 (0)