aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-11-19 04:27:51 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-11-19 04:27:51 +0000
commitc48f897bbe0c6e7909db6d8b80c7b97f0631c3ca (patch)
treeb2fd168dc9a2d49a015b036755b5e7183ecb6775 /sys/kern
parent431fb8abd7946ccb6710b41337ba8476fea448f2 (diff)
downloadsrc-c48f897bbe0c6e7909db6d8b80c7b97f0631c3ca.tar.gz
src-c48f897bbe0c6e7909db6d8b80c7b97f0631c3ca.zip
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.
Notes
Notes: svn path=/head/; revision=367829
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_smp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
index 9da7ea869f86..093622d8f6aa 100644
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -896,6 +896,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.
*/