]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RISC-V: Fix MEMREMAP_WB for systems with Svpbmt
authorAnup Patel <apatel@ventanamicro.com>
Mon, 14 Nov 2022 09:05:34 +0000 (14:35 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:26:23 +0000 (13:26 +0100)
commit758956e000bc667cc86219a0e56a04b2e674e24c
tree8890cd20ca605dc34b4bd3992b1278f4f4ba0dd2
parent9dc86d1a316d2cbb935129d2a8d0c95d6f5c2ae5
RISC-V: Fix MEMREMAP_WB for systems with Svpbmt

[ Upstream commit b91676fc16cd384a81e3af52c641aa61985cc231 ]

Currently, the memremap() called with MEMREMAP_WB maps memory using
the generic ioremap() function which breaks on system with Svpbmt
because memory mapped using _PAGE_IOREMAP page attributes is treated
as strongly-ordered non-cacheable IO memory.

To address this, we implement RISC-V specific arch_memremap_wb()
which maps memory using _PAGE_KERNEL page attributes resulting in
write-back cacheable mapping on systems with Svpbmt.

Fixes: ff689fd21cb1 ("riscv: add RISC-V Svpbmt extension support")
Co-developed-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20221114090536.1662624-2-apatel@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/include/asm/io.h