summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2016-01-16 11:15:37 +0000
committervisa <visa@openbsd.org>2016-01-16 11:15:37 +0000
commite352a051a3906bb525df4287207413ea3e22894a (patch)
treeef71cfe25b4189ba0a670d7de365154fa4482254
parentvmd(8) sometimes attempts page-crossing data copies between the host (diff)
downloadwireguard-openbsd-e352a051a3906bb525df4287207413ea3e22894a.tar.xz
wireguard-openbsd-e352a051a3906bb525df4287207413ea3e22894a.zip
Panic if someone boots the kernel by force without CPU 0. The system
will not work without that core.
-rw-r--r--sys/arch/octeon/octeon/machdep.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/arch/octeon/octeon/machdep.c b/sys/arch/octeon/octeon/machdep.c
index c4c5d4874ef..d75818a5ffb 100644
--- a/sys/arch/octeon/octeon/machdep.c
+++ b/sys/arch/octeon/octeon/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.70 2015/12/02 14:56:15 visa Exp $ */
+/* $OpenBSD: machdep.c,v 1.71 2016/01/16 11:15:37 visa Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
@@ -412,6 +412,15 @@ mips_init(__register_t a0, __register_t a1, __register_t a2 __unused,
#endif
/*
+ * It is possible to launch the kernel from the bootloader without
+ * physical CPU 0. That does not really work, however, because of the
+ * way how the kernel assigns and uses cpuids. Moreover, cnmac(4) is
+ * hard coded to use CPU 0 for packet reception.
+ */
+ if (!(octeon_boot_info->core_mask & 1))
+ panic("cannot run without physical CPU 0");
+
+ /*
* Init message buffer.
*/
msgbufbase = (caddr_t)pmap_steal_memory(MSGBUFSIZE, NULL,NULL);