LoongArch: Set _PAGE_DIRTY only if _PAGE_MODIFIED is set in {pmd,pte}_mkwrite()
authorHuacai Chen <chenhuacai@loongson.cn>
Mon, 21 Nov 2022 11:02:57 +0000 (19:02 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Mon, 21 Nov 2022 11:02:57 +0000 (19:02 +0800)
commit54e6cd42a183b602e3627ad3aaeeed44f7443e67
tree961d2bdb58dbb0c805c9c0d76105db8e4c2b3d91
parentbf2f34a506e66e2979de6b17c337c5d4b25b4d2c
LoongArch: Set _PAGE_DIRTY only if _PAGE_MODIFIED is set in {pmd,pte}_mkwrite()

Set _PAGE_DIRTY only if _PAGE_MODIFIED is set in {pmd,pte}_mkwrite().
Otherwise, _PAGE_DIRTY silences the TLB modify exception and make us
have no chance to mark a pmd/pte dirty (_PAGE_MODIFIED) for software.

Reviewed-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/pgtable.h