Skip to content

Commit 7e38115

Browse files
Alexandre Ghitipalmer-dabbelt
authored andcommitted
riscv: Implement flush_cache_vmap()
The RISC-V kernel needs a sfence.vma after a page table modification: we used to rely on the vmalloc fault handling to emit an sfence.vma, but commit 7d3332b ("riscv: mm: Pre-allocate PGD entries for vmalloc/modules area") got rid of this path for 64-bit kernels, so now we need to explicitly emit a sfence.vma in flush_cache_vmap(). Note that we don't need to implement flush_cache_vunmap() as the generic code should emit a flush tlb after unmapping a vmalloc region. Fixes: 7d3332b ("riscv: mm: Pre-allocate PGD entries for vmalloc/modules area") Signed-off-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent d566bea commit 7e38115

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/riscv/include/asm/cacheflush.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ static inline void flush_dcache_page(struct page *page)
3737
#define flush_icache_user_page(vma, pg, addr, len) \
3838
flush_icache_mm(vma->vm_mm, 0)
3939

40+
#ifdef CONFIG_64BIT
41+
#define flush_cache_vmap(start, end) flush_tlb_kernel_range(start, end)
42+
#endif
43+
4044
#ifndef CONFIG_SMP
4145

4246
#define flush_icache_all() local_flush_icache_all()

0 commit comments

Comments
 (0)