aboutsummaryrefslogtreecommitdiffstats
path: root/arch/riscv/include/asm/pgtable.h
diff options
context:
space:
mode:
authorNanyong Sun <sunnanyong@huawei.com>2021-04-30 16:28:48 +0800
committerPalmer Dabbelt <palmerdabbelt@google.com>2021-05-22 10:19:38 -0700
commit141682f5b9d658b5fba7c33cf8574329a7840cdc (patch)
tree414c63b8c8d269007e06a0ea44e45b7eec9cbd8d /arch/riscv/include/asm/pgtable.h
parentriscv: mm: add _PAGE_LEAF macro (diff)
downloadlinux-dev-141682f5b9d658b5fba7c33cf8574329a7840cdc.tar.xz
linux-dev-141682f5b9d658b5fba7c33cf8574329a7840cdc.zip
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 <sunnanyong@huawei.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/include/asm/pgtable.h')
-rw-r--r--arch/riscv/include/asm/pgtable.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index dbced7d37768..b06eb8394e4e 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -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