summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorTobias Weingartner <weingart@cvs.openbsd.org>2008-12-04 15:48:20 +0000
committerTobias Weingartner <weingart@cvs.openbsd.org>2008-12-04 15:48:20 +0000
commit1820d03152ff2b43ec6a9c80ca7c1e168137b675 (patch)
treebe1ffe91c84a5f2512e166b8226141b5e0cd9b09 /sys/arch/amd64
parentcc0a0f7a5222febc840d50dd02954aaf09a28104 (diff)
Fix "fp_save ipi didn't" panic, and move i386/amd64 closer in the process.
Positive test results by a handful of people. Ok kettenis@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/fpu.c25
-rw-r--r--sys/arch/amd64/amd64/lock_machdep.c4
-rw-r--r--sys/arch/amd64/amd64/pmap.c5
-rw-r--r--sys/arch/amd64/include/lock.h3
4 files changed, 8 insertions, 29 deletions
diff --git a/sys/arch/amd64/amd64/fpu.c b/sys/arch/amd64/amd64/fpu.c
index ae14f4a4a36..e9a5c0f748b 100644
--- a/sys/arch/amd64/amd64/fpu.c
+++ b/sys/arch/amd64/amd64/fpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpu.c,v 1.13 2007/11/12 14:47:56 millert Exp $ */
+/* $OpenBSD: fpu.c,v 1.14 2008/12/04 15:48:19 weingart Exp $ */
/* $NetBSD: fpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*-
@@ -59,6 +59,7 @@
#include <machine/trap.h>
#include <machine/specialreg.h>
#include <machine/fpu.h>
+#include <machine/lock.h>
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
@@ -311,28 +312,10 @@ fpusave_proc(struct proc *p, int save)
fpusave_cpu(ci, save);
splx(s);
} else {
-#ifdef DIAGNOSTIC
- int spincount;
-#endif
-
x86_send_ipi(oci,
- save ? X86_IPI_SYNCH_FPU : X86_IPI_FLUSH_FPU);
-
-#ifdef DIAGNOSTIC
- spincount = 0;
-#endif
+ save ? X86_IPI_SYNCH_FPU : X86_IPI_FLUSH_FPU);
while (p->p_addr->u_pcb.pcb_fpcpu != NULL)
-#ifdef DIAGNOSTIC
- {
- spincount++;
- if (spincount > 10000000) {
- panic("fp_save ipi didn't");
- }
- }
-#else
- __splbarrier(); /* XXX replace by generic barrier */
- ;
-#endif
+ SPINLOCK_SPIN_HOOK;
}
#else
KASSERT(ci->ci_fpcurproc == p);
diff --git a/sys/arch/amd64/amd64/lock_machdep.c b/sys/arch/amd64/amd64/lock_machdep.c
index f1740fae4e0..514fb6faf13 100644
--- a/sys/arch/amd64/amd64/lock_machdep.c
+++ b/sys/arch/amd64/amd64/lock_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lock_machdep.c,v 1.2 2007/11/27 15:55:29 art Exp $ */
+/* $OpenBSD: lock_machdep.c,v 1.3 2008/12/04 15:48:19 weingart Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
@@ -43,8 +43,6 @@ __mp_lock_init(struct __mp_lock *lock)
extern int __mp_lock_spinout;
#endif
-#define SPINLOCK_SPIN_HOOK __asm __volatile("pause": : :"memory")
-
static __inline void
__mp_lock_spin(struct __mp_lock *mpl)
{
diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c
index cf68c7d4218..6683435943a 100644
--- a/sys/arch/amd64/amd64/pmap.c
+++ b/sys/arch/amd64/amd64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.32 2008/06/10 02:55:39 weingart Exp $ */
+/* $OpenBSD: pmap.c,v 1.33 2008/12/04 15:48:19 weingart Exp $ */
/* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */
/*
@@ -2485,9 +2485,6 @@ volatile long tlb_shoot_wait;
volatile vaddr_t tlb_shoot_addr1;
volatile vaddr_t tlb_shoot_addr2;
-/* XXX */
-#define SPINLOCK_SPIN_HOOK __asm __volatile("pause": : :"memory")
-
void
pmap_tlb_shootpage(struct pmap *pm, vaddr_t va)
{
diff --git a/sys/arch/amd64/include/lock.h b/sys/arch/amd64/include/lock.h
index 34e57d53325..2dfd082f08c 100644
--- a/sys/arch/amd64/include/lock.h
+++ b/sys/arch/amd64/include/lock.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lock.h,v 1.4 2008/06/26 05:42:09 ray Exp $ */
+/* $OpenBSD: lock.h,v 1.5 2008/12/04 15:48:19 weingart Exp $ */
/* $NetBSD: lock.h,v 1.1.2.2 2000/05/03 14:40:55 sommerfeld Exp $ */
/*-
@@ -51,6 +51,7 @@ typedef __volatile int __cpu_simple_lock_t;
*/
#define __lockbarrier() __asm __volatile("": : :"memory")
+#define SPINLOCK_SPIN_HOOK __asm __volatile("pause": : :"memory");
#include <machine/atomic.h>