riscv: mm: Broadcast kernel TLB flushes only when needed
authorSamuel Holland <samuel.holland@sifive.com>
Wed, 27 Mar 2024 04:49:45 +0000 (21:49 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 29 Apr 2024 17:49:27 +0000 (10:49 -0700)
commit038ac18aae935c89c874649acde5a82f588a12b4
treef55016dfc1654214b27745861d218cd274074367
parentdc892fb443224da7018891a5fac9cb6ac50c14b3
riscv: mm: Broadcast kernel TLB flushes only when needed

__flush_tlb_range() avoids broadcasting TLB flushes when an mm context
is only active on the local CPU. Apply this same optimization to TLB
flushes of kernel memory when only one CPU is online. This check can be
constant-folded when SMP is disabled.

Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Link: https://lore.kernel.org/r/20240327045035.368512-5-samuel.holland@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/mm/tlbflush.c