Skip to content

Commit b91676f

Browse files
avpatelpalmer-dabbelt
authored andcommitted
RISC-V: Fix MEMREMAP_WB for systems with Svpbmt
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: ff689fd ("riscv: add RISC-V Svpbmt extension support") Co-developed-by: Mayuresh Chitale <[email protected]> Signed-off-by: Mayuresh Chitale <[email protected]> Signed-off-by: Anup Patel <[email protected]> Acked-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 9abf231 commit b91676f

File tree

1 file changed

+5
-0
lines changed
  • arch/riscv/include/asm

1 file changed

+5
-0
lines changed

arch/riscv/include/asm/io.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,9 @@ __io_writes_outs(outs, u64, q, __io_pbr(), __io_paw())
135135

136136
#include <asm-generic/io.h>
137137

138+
#ifdef CONFIG_MMU
139+
#define arch_memremap_wb(addr, size) \
140+
((__force void *)ioremap_prot((addr), (size), _PAGE_KERNEL))
141+
#endif
142+
138143
#endif /* _ASM_RISCV_IO_H */

0 commit comments

Comments
 (0)