diff options
author | Hongchen Zhang <zhanghongchen@loongson.cn> | 2023-06-15 14:35:52 +0800 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2023-06-15 14:35:52 +0800 |
commit | ddc1729b07cc84bb29f577698b8d2e74a4004a6e (patch) | |
tree | aa059fbf86c4d94662b3e9378a2e7d9848935c2d /arch/loongarch/include/asm/pgtable-bits.h | |
parent | 858fd168a95c5b9669aac8db6c14a9aeab446375 (diff) | |
download | linux-ddc1729b07cc84bb29f577698b8d2e74a4004a6e.tar.gz linux-ddc1729b07cc84bb29f577698b8d2e74a4004a6e.tar.bz2 linux-ddc1729b07cc84bb29f577698b8d2e74a4004a6e.zip |
LoongArch: Let pmd_present() return true when splitting pmd
When we split a pmd into ptes, pmd_present() and pmd_trans_huge() should
return true, otherwise it would be treated as a swap pmd.
This is the same as arm64 does in commit b65399f6111b ("arm64/mm: Change
THP helpers to comply with generic MM semantics"), we also add a new bit
named _PAGE_PRESENT_INVALID for LoongArch.
Signed-off-by: Hongchen Zhang <zhanghongchen@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/include/asm/pgtable-bits.h')
-rw-r--r-- | arch/loongarch/include/asm/pgtable-bits.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/loongarch/include/asm/pgtable-bits.h b/arch/loongarch/include/asm/pgtable-bits.h index 8b98d22a145b..de46a6b1e9f1 100644 --- a/arch/loongarch/include/asm/pgtable-bits.h +++ b/arch/loongarch/include/asm/pgtable-bits.h @@ -22,12 +22,14 @@ #define _PAGE_PFN_SHIFT 12 #define _PAGE_SWP_EXCLUSIVE_SHIFT 23 #define _PAGE_PFN_END_SHIFT 48 +#define _PAGE_PRESENT_INVALID_SHIFT 60 #define _PAGE_NO_READ_SHIFT 61 #define _PAGE_NO_EXEC_SHIFT 62 #define _PAGE_RPLV_SHIFT 63 /* Used by software */ #define _PAGE_PRESENT (_ULCAST_(1) << _PAGE_PRESENT_SHIFT) +#define _PAGE_PRESENT_INVALID (_ULCAST_(1) << _PAGE_PRESENT_INVALID_SHIFT) #define _PAGE_WRITE (_ULCAST_(1) << _PAGE_WRITE_SHIFT) #define _PAGE_ACCESSED (_ULCAST_(1) << _PAGE_ACCESSED_SHIFT) #define _PAGE_MODIFIED (_ULCAST_(1) << _PAGE_MODIFIED_SHIFT) |