]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
riscv: Use accessors to page table entries instead of direct dereference
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Wed, 13 Dec 2023 20:30:01 +0000 (21:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:11:40 +0000 (11:11 +0200)
commite0316069fae7fbc7a89e024103eb76a3c4ce5dce
treeba75d6c40d4f3f66ed0d3eb1718b8a4f6bfe6bb4
parent59c9160a7ee3ff1cbabf5cd238a5b68819624d7d
riscv: Use accessors to page table entries instead of direct dereference

commit edf955647269422e387732870d04fc15933a25ea upstream.

As very well explained in commit 20a004e7b017 ("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 riscv which is such architecture.

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Acked-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20231213203001.179237-5-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/riscv/include/asm/kfence.h
arch/riscv/include/asm/pgtable-64.h
arch/riscv/include/asm/pgtable.h
arch/riscv/kernel/efi.c
arch/riscv/kvm/mmu.c
arch/riscv/mm/fault.c
arch/riscv/mm/hugetlbpage.c
arch/riscv/mm/kasan_init.c
arch/riscv/mm/pageattr.c
arch/riscv/mm/pgtable.c