Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

riscv: switch set_icache_stale_mask() to using non-atomic assign_cpu()

The atomic cpumask_assign_cpu() follows non-atomic cpumask_setall(),
which makes the whole operation non-atomic. Fix this by relaxing to
non-atomic __assign_cpu().

Fixes: 7c1e5b9690b0e14 ("riscv: Disable preemption while handling PR_RISCV_CTX_SW_FENCEI_OFF")
Signed-off-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>

+1 -1
+1 -1
arch/riscv/mm/cacheflush.c
··· 172 172 stale_cpu = cpumask_test_cpu(cpu, mask); 173 173 174 174 cpumask_setall(mask); 175 - cpumask_assign_cpu(cpu, mask, stale_cpu); 175 + __assign_cpu(cpu, mask, stale_cpu); 176 176 put_cpu(); 177 177 } 178 178 #endif