summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormlarkin <mlarkin@openbsd.org>2010-06-26 15:56:40 +0000
committermlarkin <mlarkin@openbsd.org>2010-06-26 15:56:40 +0000
commit3efaaf4227ba5b81b71e4ea4d348a38a09ca312d (patch)
treefd3ae1e798a74b0d5d38080b024ca714c4c142f7
parentsync (diff)
downloadwireguard-openbsd-3efaaf4227ba5b81b71e4ea4d348a38a09ca312d.tar.xz
wireguard-openbsd-3efaaf4227ba5b81b71e4ea4d348a38a09ca312d.zip
Don't try to halt an AP if holding sched_lock since that causes hangs
on resume. Fail early if this is detected, so that we have a chance to catch it. ok kettenis@, deraadt@
-rw-r--r--sys/arch/amd64/amd64/ipifuncs.c3
-rw-r--r--sys/arch/i386/i386/ipifuncs.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/ipifuncs.c b/sys/arch/amd64/amd64/ipifuncs.c
index d8615ef350b..73fed196631 100644
--- a/sys/arch/amd64/amd64/ipifuncs.c
+++ b/sys/arch/amd64/amd64/ipifuncs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipifuncs.c,v 1.11 2010/04/07 06:33:06 kettenis Exp $ */
+/* $OpenBSD: ipifuncs.c,v 1.12 2010/06/26 15:56:40 mlarkin Exp $ */
/* $NetBSD: ipifuncs.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*-
@@ -97,6 +97,7 @@ x86_64_ipi_nop(struct cpu_info *ci)
void
x86_64_ipi_halt(struct cpu_info *ci)
{
+ SCHED_ASSERT_UNLOCKED();
disable_intr();
ci->ci_flags &= ~CPUF_RUNNING;
wbinvd();
diff --git a/sys/arch/i386/i386/ipifuncs.c b/sys/arch/i386/i386/ipifuncs.c
index 76c4df59186..3d2dcf64916 100644
--- a/sys/arch/i386/i386/ipifuncs.c
+++ b/sys/arch/i386/i386/ipifuncs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipifuncs.c,v 1.16 2010/04/07 06:33:06 kettenis Exp $ */
+/* $OpenBSD: ipifuncs.c,v 1.17 2010/06/26 15:56:40 mlarkin Exp $ */
/* $NetBSD: ipifuncs.c,v 1.1.2.3 2000/06/26 02:04:06 sommerfeld Exp $ */
/*-
@@ -100,6 +100,7 @@ i386_ipi_nop(struct cpu_info *ci)
void
i386_ipi_halt(struct cpu_info *ci)
{
+ SCHED_ASSERT_UNLOCKED();
disable_intr();
ci->ci_flags &= ~CPUF_RUNNING;
wbinvd();