riscv: Only send remote fences when some other CPU is online
authorSamuel Holland <samuel.holland@sifive.com>
Wed, 27 Mar 2024 04:49:46 +0000 (21:49 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 29 Apr 2024 17:49:28 +0000 (10:49 -0700)
commit9546f00410ed88b8117388cfd74ea59f4616a158
tree1c0d8fc79fd666a1caf2c7a501ffef7d16a6354d
parent038ac18aae935c89c874649acde5a82f588a12b4
riscv: Only send remote fences when some other CPU is online

If no other CPU is online, a local cache or TLB flush is sufficient.
These checks can be constant-folded when SMP is disabled.

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