linux-stable/arch/nios2
Alexandre Ghiti c4a05cf0ed mm: Introduce flush_cache_vmap_early()
[ Upstream commit 7a92fc8b4d ]

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>
Stable-dep-of: d9807d60c1 ("riscv: mm: execute local TLB flush after populating vmemmap")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-16 19:10:52 +01:00
..
boot nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-13 16:59:46 -05:00
configs treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
include mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
kernel nios2: Replace all non-returning strlcpy with strscpy 2023-06-13 16:51:49 -05:00
lib
mm nios2: fix flush_dcache_page() for usage from irq context 2023-08-24 16:20:31 -07:00
platform
Kbuild
Kconfig mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-06-24 14:12:58 -07:00
Kconfig.debug
Makefile