[PATCH v2] riscv: smp: set CPU 0 possible in setup_smp()
Paul Walmsley
pjw at kernel.org
Tue Jul 14 18:41:09 PDT 2026
On Tue, 14 Jul 2026, Paul Sherman wrote:
> setup_smp() calls set_cpu_possible() for CPUs 1..nr_cpu_ids-1 but
> never for CPU 0 (the boot CPU). x86 handles this via
> init_cpu_possible(cpumask_of(0)); RISC-V has no equivalent.
>
> Without CPU 0 in cpu_possible_mask, rcu_init_one()'s
> for_each_possible_cpu() loop skips it, leaving rdp->mynode=NULL.
> rcutree_prepare_cpu() then dereferences NULL and hangs.
>
> Exposed on Sophgo SG2042 (64-hart, 4-NUMA) with Linux 7.2-rc3.
>
> Fixes: a4166aec1130 ("riscv: Deduplicate code in setup_smp()")
> Signed-off-by: Paul Sherman <shermanpauldylan at gmail.com>
Thanks, queued for v7.2-rc.
- Paul
More information about the linux-riscv
mailing list