summaryrefslogtreecommitdiff
path: root/arch/riscv/mm/cacheflush.c
diff options
context:
space:
mode:
authorAtish Patra <atishp@rivosinc.com>2022-01-20 12:09:18 +0300
committerPalmer Dabbelt <palmer@rivosinc.com>2022-01-20 20:27:22 +0300
commit26fb751ca37846c912daa347be298bfd945cc560 (patch)
tree545d865d622b096c9c193adba2ebd64b3d79c76a /arch/riscv/mm/cacheflush.c
parent2ffc48fc7071da4b2d881b0f21d37ed05feb697b (diff)
downloadlinux-26fb751ca37846c912daa347be298bfd945cc560.tar.xz
RISC-V: Do not use cpumask data structure for hartid bitmap
Currently, SBI APIs accept a hartmask that is generated from struct cpumask. Cpumask data structure can hold upto NR_CPUs value. Thus, it is not the correct data structure for hartids as it can be higher than NR_CPUs for platforms with sparse or discontguous hartids. Remove all association between hartid mask and struct cpumask. Reviewed-by: Anup Patel <anup@brainfault.org> (For Linux RISC-V changes) Acked-by: Anup Patel <anup@brainfault.org> (For KVM RISC-V changes) Signed-off-by: Atish Patra <atishp@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/mm/cacheflush.c')
-rw-r--r--arch/riscv/mm/cacheflush.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/riscv/mm/cacheflush.c b/arch/riscv/mm/cacheflush.c
index 89f81067e09e..6cb7d96ad9c7 100644
--- a/arch/riscv/mm/cacheflush.c
+++ b/arch/riscv/mm/cacheflush.c
@@ -67,10 +67,7 @@ void flush_icache_mm(struct mm_struct *mm, bool local)
*/
smp_mb();
} else if (IS_ENABLED(CONFIG_RISCV_SBI)) {
- cpumask_t hartid_mask;
-
- riscv_cpuid_to_hartid_mask(&others, &hartid_mask);
- sbi_remote_fence_i(cpumask_bits(&hartid_mask));
+ sbi_remote_fence_i(&others);
} else {
on_each_cpu_mask(&others, ipi_remote_fence_i, NULL, 1);
}