OpenCloudOS-Kernel/arch/csky/abiv2
Alexandre Ghiti c4a05cf0ed mm: Introduce flush_cache_vmap_early()
[ Upstream commit 7a92fc8b4d20680e4c20289a670d8fca2d1f2c1b ]

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: d9807d60c145 ("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
..
inc/abi mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
Makefile csky: Add C based string functions 2022-04-18 21:23:55 +08:00
cacheflush.c - Some swap cleanups from Ma Wupeng ("fix WARN_ON in add_to_avail_list") 2023-08-29 14:25:26 -07:00
fpu.c csky: Fixup init_fpu compile warning with __init 2020-03-08 20:55:14 +08:00
mcount.S csky: Fixup kprobes handler couldn't change pc 2020-07-31 01:51:57 +00:00
memcmp.S csky: Library functions 2018-10-26 00:54:24 +08:00
memcpy.S csky: fixup remove vdsp implement for kernel. 2018-12-31 22:56:59 +08:00
memmove.S csky: Fixup vdsp&fpu issues in kernel 2019-04-22 13:44:57 +08:00
memset.S csky: Library functions 2018-10-26 00:54:24 +08:00
strcmp.S csky: Library functions 2018-10-26 00:54:24 +08:00
strcpy.S csky: Library functions 2018-10-26 00:54:24 +08:00
strksyms.c csky: Add C based string functions 2022-04-18 21:23:55 +08:00
strlen.S csky: Library functions 2018-10-26 00:54:24 +08:00
sysdep.h csky: Fixup compile error 2021-02-27 22:04:14 +08:00