diff options
author | gber <gber@FreeBSD.org> | 2013-05-06 14:27:46 +0000 |
---|---|---|
committer | gber <gber@FreeBSD.org> | 2013-05-06 14:27:46 +0000 |
commit | ec12f28a77580cdaefb7a049e07c049a980d3ba4 (patch) | |
tree | 4b85eba35c16cf6319496d885dfd48773a2b5cc5 /sys/arm | |
parent | 5bbe70ff76cd7e4a7b1944ed0c63396cf3b96176 (diff) | |
download | FreeBSD-src-ec12f28a77580cdaefb7a049e07c049a980d3ba4.zip FreeBSD-src-ec12f28a77580cdaefb7a049e07c049a980d3ba4.tar.gz |
Avoid calling pcpu_init() simultaneously.
pcpu_init() updates queue, so cannot be called by multiple cores
at the same time
Obtained from: Semihalf
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/mp_machdep.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arm/arm/mp_machdep.c b/sys/arm/arm/mp_machdep.c index 99b750d..2193266 100644 --- a/sys/arm/arm/mp_machdep.c +++ b/sys/arm/arm/mp_machdep.c @@ -173,8 +173,15 @@ init_secondary(int cpu) pc = &__pcpu[cpu]; set_pcpu(pc); - pcpu_init(pc, cpu, sizeof(struct pcpu)); + /* + * pcpu_init() updates queue, so it should not be executed in parallel + * on several cores + */ + while(mp_naps < (cpu - 1)) + ; + + pcpu_init(pc, cpu, sizeof(struct pcpu)); dpcpu_init(dpcpu[cpu - 1], cpu); /* Provide stack pointers for other processor modes. */ |