linux-stable/arch/riscv
Sergey Matyukevich 85292a2968 riscv: mm: notify remote harts about mmu cache updates
commit 4bd1d80efb upstream.

Current implementation of update_mmu_cache function performs local TLB
flush. It does not take into account ASID information. Besides, it does
not take into account other harts currently running the same mm context
or possible migration of the running context to other harts. Meanwhile
TLB flush is not performed for every context switch if ASID support
is enabled.

Patch [1] proposed to add ASID support to update_mmu_cache to avoid
flushing local TLB entirely. This patch takes into account other
harts currently running the same mm context as well as possible
migration of this context to other harts.

For this purpose the approach from flush_icache_mm is reused. Remote
harts currently running the same mm context are informed via SBI calls
that they need to flush their local TLBs. All the other harts are marked
as needing a deferred TLB flush when this mm context runs on them.

[1] https://lore.kernel.org/linux-riscv/20220821013926.8968-1-tjytimi@163.com/

Signed-off-by: Sergey Matyukevich <sergey.matyukevich@syntacore.com>
Fixes: 65d4b9c530 ("RISC-V: Implement ASID allocator")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/linux-riscv/20220829205219.283543-1-geomatsi@gmail.com/#t
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-07 11:11:53 +01:00
..
boot riscv: dts: microchip: remove pcie node from the sev kit 2022-12-31 13:31:52 +01:00
configs riscv: enable CD-ROM file systems in defconfig 2022-08-25 17:01:09 -07:00
errata Merge patch series "Some style cleanups for recent extension additions" 2022-10-13 08:46:31 -07:00
include riscv: mm: notify remote harts about mmu cache updates 2023-01-07 11:11:53 +01:00
kernel riscv: stacktrace: Fixup ftrace_graph_ret_addr retp argument 2023-01-07 11:11:53 +01:00
kvm RISC-V: KVM: Fix reg_val check in kvm_riscv_vcpu_set_reg_config() 2022-12-31 13:32:51 +01:00
lib riscv: lib: uaccess: fix CSR_STATUS SR_SUM bit 2022-08-10 14:06:31 -07:00
mm riscv: mm: notify remote harts about mmu cache updates 2023-01-07 11:11:53 +01:00
net riscv, bpf: Emit fixed-length instructions for BPF_PSEUDO_FUNC 2022-12-31 13:32:23 +01:00
purgatory riscv/purgatory: Omit use of bin2c 2022-08-11 09:32:34 -07:00
Kbuild riscv: move errata/ and kvm/ builds to arch/riscv/Kbuild 2022-06-01 22:26:32 -07:00
Kconfig riscv: Fixup compile error with !MMU 2023-01-07 11:11:53 +01:00
Kconfig.debug RISC-V: Remove EARLY_PRINTK support 2018-12-17 10:23:46 -08:00
Kconfig.erratas riscv: make t-head erratas depend on MMU 2022-09-17 01:48:22 -07:00
Kconfig.socs riscv: Kconfig: Style cleanups 2022-06-30 19:26:16 -07:00
Makefile Merge patch series "Fix RISC-V toolchain extension support detection" 2022-10-27 15:14:07 -07:00