From c48f897bbe0c6e7909db6d8b80c7b97f0631c3ca Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Thu, 19 Nov 2020 04:27:51 +0000 Subject: [PATCH] smp: fix smp_rendezvous_cpus_retry usage before smp starts Since none of the other CPUs are running there is nobody to clear their entries and the routine spins indefinitely. --- sys/kern/subr_smp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 9da7ea869f8..093622d8f6a 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -895,6 +895,21 @@ smp_rendezvous_cpus_retry(cpuset_t map, { int cpu; + /* + * Only one CPU to execute on. + */ + if (!smp_started) { + spinlock_enter(); + if (setup_func != NULL) + setup_func(arg); + if (action_func != NULL) + action_func(arg); + if (teardown_func != NULL) + teardown_func(arg); + spinlock_exit(); + return; + } + /* * Execute an action on all specified CPUs while retrying until they * all acknowledge completion. -- 2.45.0