summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2015-08-19 13:14:09 +0000
committervisa <visa@openbsd.org>2015-08-19 13:14:09 +0000
commit0480544dde3143c0010d50a7579bab0c347dd259 (patch)
tree6082bb756c1481086a77589898cdfaf9df66d26e
parentSupport for overwriting $ENV:: variables in OpenSSL .cnf files from (diff)
downloadwireguard-openbsd-0480544dde3143c0010d50a7579bab0c347dd259.tar.xz
wireguard-openbsd-0480544dde3143c0010d50a7579bab0c347dd259.zip
Halt extra cores on SP kernel, to avoid trashing the system if there
is more than one active CPU. Additionally pick an init core at runtime. This allows booting the system with a set of CPUs that does not contain core 0, at least in terms of the early-stage boot code. ok jasper@ (a while ago)
-rw-r--r--sys/arch/octeon/octeon/locore.S16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/arch/octeon/octeon/locore.S b/sys/arch/octeon/octeon/locore.S
index fe86a51a103..3c265451ae8 100644
--- a/sys/arch/octeon/octeon/locore.S
+++ b/sys/arch/octeon/octeon/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.6 2014/03/13 02:17:13 yasuoka Exp $ */
+/* $OpenBSD: locore.S,v 1.7 2015/08/19 13:14:09 visa Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -73,10 +73,11 @@ start:
LA gp, _gp
-#if defined(MULTIPROCESSOR)
- rdhwr t2, $0
- beqz t2, 2f
+ /* Let the init core continue. The others have to wait. */
+ bne a2, zero, 2f
nop
+#if defined(MULTIPROCESSOR)
+ rdhwr t2, $0
1: ll t0, cpu_spinup_mask
bne t2, t0, 1b
nop
@@ -86,8 +87,13 @@ start:
nop
j hw_cpu_spinup_trampoline
nop
-2:
+#else
+ /* Halt extra cores on single-processor kernel. */
+1: wait
+ j 1b
+ nop
#endif
+2:
/*
* Initialize stack and call machine startup.
*/