Skip to content

Commit

Permalink
riscv: mm: make pmd_bad() check leaf condition
Browse files Browse the repository at this point in the history
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 <sunnanyong@huawei.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
  • Loading branch information
Nanyong Sun authored and Palmer Dabbelt committed May 22, 2021
1 parent f5397c3 commit 141682f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/riscv/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static inline int pmd_none(pmd_t pmd)

static inline int pmd_bad(pmd_t pmd)
{
return !pmd_present(pmd);
return !pmd_present(pmd) || (pmd_val(pmd) & _PAGE_LEAF);
}

#define pmd_leaf pmd_leaf
Expand Down

0 comments on commit 141682f

Please sign in to comment.