diff options
author | 2016-01-16 11:21:42 +0000 | |
---|---|---|
committer | 2016-01-16 11:21:42 +0000 | |
commit | 18dfecec4a047162195e6ecbcc506e6a5ccd0d48 (patch) | |
tree | eaaf5598f99529b8e1e5ef245f4f21c0ca94360c | |
parent | Panic if someone boots the kernel by force without CPU 0. The system (diff) | |
download | wireguard-openbsd-18dfecec4a047162195e6ecbcc506e6a5ccd0d48.tar.xz wireguard-openbsd-18dfecec4a047162195e6ecbcc506e6a5ccd0d48.zip |
Attach secondary CPUs by coremask. This fixes a crash that happened if
the MP kernel was booted with coremask=1.
-rw-r--r-- | sys/arch/octeon/dev/mainbus.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/arch/octeon/dev/mainbus.c b/sys/arch/octeon/dev/mainbus.c index ef80004197a..f9d6f8d3da4 100644 --- a/sys/arch/octeon/dev/mainbus.c +++ b/sys/arch/octeon/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.7 2014/07/14 10:23:58 jasper Exp $ */ +/* $OpenBSD: mainbus.c,v 1.8 2016/01/16 11:21:42 visa Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -31,6 +31,7 @@ #include <sys/device.h> #include <machine/autoconf.h> +#include <machine/octeonvar.h> int mainbus_match(struct device *, void *, void *); void mainbus_attach(struct device *, struct device *, void *); @@ -61,6 +62,7 @@ mainbus_attach(struct device *parent, struct device *self, void *aux) struct cpu_attach_args caa; #ifdef MULTIPROCESSOR struct cpu_hwinfo hw; + int cpuid; #endif printf("\n"); @@ -71,9 +73,12 @@ mainbus_attach(struct device *parent, struct device *self, void *aux) config_found(self, &caa, mainbus_print); #ifdef MULTIPROCESSOR - bcopy(&bootcpu_hwinfo, &hw, sizeof(struct cpu_hwinfo)); - caa.caa_hw = &hw; - config_found(self, &caa, mainbus_print); + for (cpuid = 1; cpuid < OCTEON_MAXCPUS && + octeon_boot_info->core_mask & (1 << cpuid); cpuid++) { + bcopy(&bootcpu_hwinfo, &hw, sizeof(struct cpu_hwinfo)); + caa.caa_hw = &hw; + config_found(self, &caa, mainbus_print); + } #endif caa.caa_maa.maa_name = "clock"; |