summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-04-13 16:11:29 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-04-13 16:11:29 +0000
commitd74f45e7cbd950f0542efb46ad331e44e3bdb19e (patch)
treede224cd8f218ccff3bbd2ee504141a4f1cddb1c4
parent05965f17677ef071bae9ad3e6ea2fc3ab30a2ef1 (diff)
lear CPUF_RUNNING when halting a CPU. Fixes problems with powering dowm
MP amd64 systems for quite a few people. ok deraadt@, krw@
-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 11434d9eee1..d6792d35c14 100644
--- a/sys/arch/amd64/amd64/ipifuncs.c
+++ b/sys/arch/amd64/amd64/ipifuncs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipifuncs.c,v 1.7 2007/05/25 16:22:11 art Exp $ */
+/* $OpenBSD: ipifuncs.c,v 1.8 2008/04/13 16:11:28 kettenis Exp $ */
/* $NetBSD: ipifuncs.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*-
@@ -103,6 +103,7 @@ void
x86_64_ipi_halt(struct cpu_info *ci)
{
disable_intr();
+ ci->ci_flags &= ~CPUF_RUNNING;
for(;;) {
__asm __volatile("hlt");
diff --git a/sys/arch/i386/i386/ipifuncs.c b/sys/arch/i386/i386/ipifuncs.c
index 84ebc69315e..83a3c944121 100644
--- a/sys/arch/i386/i386/ipifuncs.c
+++ b/sys/arch/i386/i386/ipifuncs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipifuncs.c,v 1.10 2008/04/12 09:46:06 kettenis Exp $ */
+/* $OpenBSD: ipifuncs.c,v 1.11 2008/04/13 16:11:28 kettenis Exp $ */
/* $NetBSD: ipifuncs.c,v 1.1.2.3 2000/06/26 02:04:06 sommerfeld Exp $ */
/*-
@@ -95,6 +95,7 @@ void
i386_ipi_halt(struct cpu_info *ci)
{
disable_intr();
+ ci->ci_flags &= ~CPUF_RUNNING;
for(;;) {
asm volatile("hlt");