linux/arch/riscv/mm
Alexandre Ghiti 7a92fc8b4d mm: Introduce flush_cache_vmap_early()
The pcpu setup when using the page allocator sets up a new vmalloc
mapping very early in the boot process, so early that it cannot use the
flush_cache_vmap() function which may depend on structures not yet
initialized (for example in riscv, we currently send an IPI to flush
other cpus TLB).

But on some architectures, we must call flush_cache_vmap(): for example,
in riscv, some uarchs can cache invalid TLB entries so we need to flush
the new established mapping to avoid taking an exception.

So fix this by introducing a new function flush_cache_vmap_early() which
is called right after setting the new page table entry and before
accessing this new mapping. This new function implements a local flush
tlb on riscv and is no-op for other architectures (same as today).

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
2023-12-14 00:23:17 -08:00
..
cache-ops.c riscv: split cache ops out of dma-noncoherent.c 2023-11-07 09:37:42 -08:00
cacheflush.c RISC-V: cacheflush: Initialize CBO variables on ACPI systems 2023-10-26 09:40:34 -07:00
context.c riscv: mm: use bitmap_zero() API 2023-08-31 00:18:29 -07:00
dma-noncoherent.c riscv: split cache ops out of dma-noncoherent.c 2023-11-07 09:37:42 -08:00
extable.c riscv: extable: fix err reg writing in dedicated uaccess handler 2022-02-08 17:02:47 -08:00
fault.c riscv: handle VM_FAULT_[HWPOISON|HWPOISON_LARGE] faults instead of panicking 2023-10-06 14:11:38 -07:00
hugetlbpage.c riscv: fix set_huge_pte_at() for NAPOT mappings when a swap entry is set 2023-10-06 14:11:38 -07:00
init.c RISC-V Patches for the 6.7 Merge Window, Part 2 2023-11-10 09:23:17 -08:00
kasan_init.c RISC-V Patches for the 6.6 Merge Window, Part 1 2023-09-01 08:09:48 -07:00
Makefile riscv: split cache ops out of dma-noncoherent.c 2023-11-07 09:37:42 -08:00
pageattr.c riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings 2023-11-08 07:08:33 -08:00
pgtable.c riscv: mm: Implement pmdp_collapse_flush for THP 2023-02-01 20:52:09 -08:00
physaddr.c riscv: Use PUD/P4D/PGD pages for the linear mapping 2023-04-18 20:43:04 -07:00
pmem.c RISC-V: capitalise CMO op macros 2023-11-05 09:11:23 -08:00
ptdump.c Merge patch series "Improve PTDUMP and introduce new fields" 2023-11-05 09:41:57 -08:00
tlbflush.c mm: Introduce flush_cache_vmap_early() 2023-12-14 00:23:17 -08:00