summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2008-07-12 14:26:07 +0000
committerkettenis <kettenis@openbsd.org>2008-07-12 14:26:07 +0000
commitd7848516b7336c960196d6e969d5c7c65a79c61b (patch)
tree9c4e81ca792d273d6dc4cba81e963e821e30151c /sys
parentAdd core(4). (diff)
downloadwireguard-openbsd-d7848516b7336c960196d6e969d5c7c65a79c61b.tar.xz
wireguard-openbsd-d7848516b7336c960196d6e969d5c7c65a79c61b.zip
Add a temporary hack to attach only the first thread of every core for
MULTIPROCESSOR kernels. We map 'struct cpuinfo' at the same virtual address on every processor, but since threads on the same core share an MMU this doesn't quite work. With the hack we are at least able to use the other core (and any additional processors).
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/conf/GENERIC.MP3
-rw-r--r--sys/arch/sparc64/sparc64/cpu.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/arch/sparc64/conf/GENERIC.MP b/sys/arch/sparc64/conf/GENERIC.MP
index 42cb04e1086..f3c03f0250b 100644
--- a/sys/arch/sparc64/conf/GENERIC.MP
+++ b/sys/arch/sparc64/conf/GENERIC.MP
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC.MP,v 1.3 2008/07/06 08:53:38 kettenis Exp $
+# $OpenBSD: GENERIC.MP,v 1.4 2008/07/12 14:26:07 kettenis Exp $
include "arch/sparc64/conf/GENERIC"
@@ -8,3 +8,4 @@ option MULTIPROCESSOR
cpu* at mainbus?
cpu* at ssm?
cpu* at cmp?
+cpu* at core?
diff --git a/sys/arch/sparc64/sparc64/cpu.c b/sys/arch/sparc64/sparc64/cpu.c
index f4bf09af42c..fbd6d202875 100644
--- a/sys/arch/sparc64/sparc64/cpu.c
+++ b/sys/arch/sparc64/sparc64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.43 2008/07/12 07:37:25 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.44 2008/07/12 14:26:07 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.13 2001/05/26 21:27:15 chs Exp $ */
/*
@@ -209,6 +209,12 @@ cpu_match(parent, vcf, aux)
if (portid != cpus->ci_upaid)
return (0);
+#else
+ /* XXX Only attach the first thread of a core for now. */
+ if (OF_getprop(OF_parent(ma->ma_node), "device_type",
+ buf, sizeof(buf)) >= 0 && strcmp(buf, "core") == 0 &&
+ (getpropint(ma->ma_node, "cpuid", -1) % 2) == 1)
+ return (0);
#endif
return (1);