]> www.infradead.org Git - users/dwmw2/linux.git/commit
LoongArch: Use accessors to page table entries instead of direct dereference
authorHuacai Chen <chenhuacai@loongson.cn>
Wed, 7 Aug 2024 09:37:11 +0000 (17:37 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Wed, 7 Aug 2024 09:37:11 +0000 (17:37 +0800)
commit4574815abf43e2bf05643e1b3f7a2e5d6df894f0
treec4f114dabbaa5c9529dd5d0c9a5e97837a564785
parente688c220732e518c2eb1639e9ef77d4a9311713c
LoongArch: Use accessors to page table entries instead of direct dereference

As very well explained in commit 20a004e7b017cce282 ("arm64: mm: Use
READ_ONCE/WRITE_ONCE when accessing page tables"), an architecture whose
page table walker can modify the PTE in parallel must use READ_ONCE()/
WRITE_ONCE() macro to avoid any compiler transformation.

So apply that to LoongArch which is such an architecture, in order to
avoid potential problems.

Similar to commit edf955647269422e ("riscv: Use accessors to page table
entries instead of direct dereference").

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/hugetlb.h
arch/loongarch/include/asm/kfence.h
arch/loongarch/include/asm/pgtable.h
arch/loongarch/kvm/mmu.c
arch/loongarch/mm/hugetlbpage.c
arch/loongarch/mm/init.c
arch/loongarch/mm/kasan_init.c
arch/loongarch/mm/pgtable.c