[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250313021953.86035-4-yury.norov@gmail.com>
Date: Wed, 12 Mar 2025 22:19:51 -0400
From: Yury Norov <yury.norov@...il.com>
To: linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org
Cc: Yury Norov <yury.norov@...il.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Charlie Jenkins <charlie@...osinc.com>,
Alexandre Ghiti <alexghiti@...osinc.com>,
Samuel Holland <samuel.holland@...ive.com>,
Anup Patel <anup@...infault.org>
Subject: [PATCH 3/4] 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 <yury.norov@...il.com>
---
arch/riscv/mm/cacheflush.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/mm/cacheflush.c b/arch/riscv/mm/cacheflush.c
index b81672729887..b8e96dfff19d 100644
--- a/arch/riscv/mm/cacheflush.c
+++ b/arch/riscv/mm/cacheflush.c
@@ -172,7 +172,7 @@ static void set_icache_stale_mask(void)
stale_cpu = cpumask_test_cpu(cpu, mask);
cpumask_setall(mask);
- cpumask_assign_cpu(cpu, mask, stale_cpu);
+ __assign_cpu(cpu, mask, stale_cpu);
put_cpu();
}
#endif
--
2.43.0
Powered by blists - more mailing lists