Skip to content

Commit ae9e9f3

Browse files
Danil SkrebenkovPaul Walmsley
authored andcommitted
RISC-V: clear hot-unplugged cores from all task mm_cpumasks to avoid rfence errors
openSBI v1.7 adds harts checks for ipi operations. Especially it adds comparison between hmask passed as an argument from linux and mask of online harts (from openSBI side). If they don't fit each other the error occurs. When cpu is offline, cpu_online_mask is explicitly cleared in __cpu_disable. However, there is no explicit clearing of mm_cpumask. mm_cpumask is used for rfence operations that call openSBI RFENCE extension which uses ipi to remote harts. If hart is offline there may be error if mask of linux is not as mask of online harts in openSBI. this patch adds explicit clearing of mm_cpumask for offline hart. Signed-off-by: Danil Skrebenkov <danil.skrebenkov@cloudbear.ru> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Link: https://lore.kernel.org/r/20250919132849.31676-1-danil.skrebenkov@cloudbear.ru [pjw@kernel.org: rewrote subject line for clarity] Signed-off-by: Paul Walmsley <pjw@kernel.org>
1 parent 781380d commit ae9e9f3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/riscv/kernel/cpu-hotplug.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
5454

5555
pr_notice("CPU%u: off\n", cpu);
5656

57+
clear_tasks_mm_cpumask(cpu);
5758
/* Verify from the firmware if the cpu is really stopped*/
5859
if (cpu_ops->cpu_is_stopped)
5960
ret = cpu_ops->cpu_is_stopped(cpu);

0 commit comments

Comments
 (0)