Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch The FP regs are accessed in both physical and virtu...
details: https://anonhg.NetBSD.org/src/rev/fccce8d8d318
branches: trunk
changeset: 753126:fccce8d8d318
user: skrll <skrll%NetBSD.org@localhost>
date: Tue Mar 16 16:20:19 2010 +0000
description:
The FP regs are accessed in both physical and virtual modes. Make sure
they're allocated in directly mapped memory to avoid aliasing problems
and unnecessary cache flushing.
Fix various names and references. If we ever directly map the uarea and
pcb we can change things at that point.
Significantly helps my J210 (PA7200).
Mostly from OpenBSD.
diffstat:
sys/arch/hp700/hp700/genassym.cf | 3 +-
sys/arch/hp700/hp700/locore.S | 9 +++----
sys/arch/hp700/hp700/machdep.c | 25 ++++++++++++++++------
sys/arch/hppa/hppa/fpu.c | 11 ++++-----
sys/arch/hppa/hppa/hppa_machdep.c | 8 +-----
sys/arch/hppa/hppa/pmap.c | 6 +---
sys/arch/hppa/hppa/process_machdep.c | 6 +---
sys/arch/hppa/hppa/trap.S | 28 +++++++++++++------------
sys/arch/hppa/hppa/trap.c | 17 ++++++---------
sys/arch/hppa/hppa/vm_machdep.c | 39 +++++++++++++++++++----------------
sys/arch/hppa/include/frame.h | 4 +-
sys/arch/hppa/include/pcb.h | 6 +---
sys/arch/hppa/include/reg.h | 4 +-
13 files changed, 83 insertions(+), 83 deletions(-)
diffs (truncated from 598 to 300 lines):
diff -r 5d9092429805 -r fccce8d8d318 sys/arch/hp700/hp700/genassym.cf
--- a/sys/arch/hp700/hp700/genassym.cf Tue Mar 16 15:49:58 2010 +0000
+++ b/sys/arch/hp700/hp700/genassym.cf Tue Mar 16 16:20:19 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.20 2009/12/10 05:10:01 rmind Exp $
+# $NetBSD: genassym.cf,v 1.21 2010/03/16 16:20:19 skrll Exp $
# $OpenBSD: genassym.cf,v 1.18 2001/09/20 18:31:14 mickey Exp $
@@ -189,7 +189,6 @@
member PCB_FPREGS pcb_fpregs
member PCB_ONFAULT pcb_onfault
member PCB_SPACE pcb_space
-member PCB_UVA pcb_uva
member PCB_KSP pcb_ksp
# system calls
diff -r 5d9092429805 -r fccce8d8d318 sys/arch/hp700/hp700/locore.S
--- a/sys/arch/hp700/hp700/locore.S Tue Mar 16 15:49:58 2010 +0000
+++ b/sys/arch/hp700/hp700/locore.S Tue Mar 16 16:20:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.43 2010/03/08 07:42:47 skrll Exp $ */
+/* $NetBSD: locore.S,v 1.44 2010/03/16 16:20:19 skrll Exp $ */
/* $OpenBSD: locore.S,v 1.158 2008/07/28 19:08:46 miod Exp $ */
/*
@@ -230,12 +230,11 @@
* kernel stack starts a page and a trapframe above uarea address.
*/
ldo NBPG+TRAPFRAME_SIZEOF(%t3), %sp
- mtctl %t3, CR_UPADDR
+ mtctl %t3, CR_FPPADDR
/* initialize the pcb */
stw %r0, PCB_ONFAULT(%t3)
stw %r0, PCB_SPACE(%t3) /* XXX HPPA_SID_KERNEL == 0 */
- stw %t3, PCB_UVA(%t3)
/*
* Setup various pointers.
@@ -857,7 +856,7 @@
mtctl %t3, %pidr2 /* pmap_activate? */
#endif
ldw TF_CR30(%t1), %t2 /* pmap_activate? */
- mtctl %t2, CR_UPADDR /* pmap_activate? */
+ mtctl %t2, CR_FPPADDR /* pmap_activate? */
mtctl %arg1, CR_CURLWP
@@ -930,7 +929,7 @@
*/
ldil L%fpu_cur_uspace, %t1
mfctl %ccr, %r1
- mfctl CR_UPADDR, %t2
+ mfctl CR_FPPADDR, %t2
ldw R%fpu_cur_uspace(%t1), %t1
depi 0, 25, 2, %r1 ; disables the FPU
comb,<>,n %t1, %t2, 0 ; nullify if LWPs different
diff -r 5d9092429805 -r fccce8d8d318 sys/arch/hp700/hp700/machdep.c
--- a/sys/arch/hp700/hp700/machdep.c Tue Mar 16 15:49:58 2010 +0000
+++ b/sys/arch/hp700/hp700/machdep.c Tue Mar 16 16:20:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.79 2010/02/16 16:56:29 skrll Exp $ */
+/* $NetBSD: machdep.c,v 1.80 2010/03/16 16:20:19 skrll Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.79 2010/02/16 16:56:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.80 2010/03/16 16:20:19 skrll Exp $");
#include "opt_cputype.h"
#include "opt_ddb.h"
@@ -107,6 +107,7 @@
#include <machine/autoconf.h>
#include <machine/bootinfo.h>
#include <machine/kcore.h>
+#include <machine/pcb.h>
#ifdef KGDB
#include "com.h"
@@ -244,6 +245,9 @@
struct extent *hp700_io_extent;
static long hp700_io_extent_store[EXTENT_FIXED_STORAGE_SIZE(64) / sizeof(long)];
+struct pool hppa_fppl;
+struct fpreg lwp0_fpregs;
+
/* Virtual page frame for /dev/mem (see mem.c) */
vaddr_t vmmap;
@@ -397,6 +401,7 @@
struct btlb_slot *btlb_slot;
int btlb_slot_i;
struct btinfo_symtab *bi_sym;
+ struct pcb *pcb0;
#ifdef KGDB
boothowto |= RB_KDB; /* go to kgdb early if compiled in. */
@@ -575,6 +580,13 @@
/* We will shortly go virtual. */
pagezero_mapped = 0;
fcacheall();
+
+ pcb0 = lwp_getpcb(&lwp0);
+ pcb0->pcb_fpregs = &lwp0_fpregs;
+ memset(&lwp0_fpregs, 0, sizeof(struct fpreg));
+
+ pool_init(&hppa_fppl, sizeof(struct fpreg), 16, 0, 0, "fppl", NULL,
+ IPL_NONE);
}
void
@@ -1856,11 +1868,10 @@
/* reset any of the pending FPU exceptions */
hppa_fpu_flush(l);
- pcb->pcb_fpregs[0] = ((uint64_t)HPPA_FPU_INIT) << 32;
- pcb->pcb_fpregs[1] = 0;
- pcb->pcb_fpregs[2] = 0;
- pcb->pcb_fpregs[3] = 0;
- fdcache(HPPA_SID_KERNEL, (vaddr_t)pcb->pcb_fpregs, 8 * 4);
+ pcb->pcb_fpregs->fpr_regs[0] = ((uint64_t)HPPA_FPU_INIT) << 32;
+ pcb->pcb_fpregs->fpr_regs[1] = 0;
+ pcb->pcb_fpregs->fpr_regs[2] = 0;
+ pcb->pcb_fpregs->fpr_regs[3] = 0;
/* setup terminal stack frame */
stack = (u_long)STACK_ALIGN(stack, 63);
diff -r 5d9092429805 -r fccce8d8d318 sys/arch/hppa/hppa/fpu.c
--- a/sys/arch/hppa/hppa/fpu.c Tue Mar 16 15:49:58 2010 +0000
+++ b/sys/arch/hppa/hppa/fpu.c Tue Mar 16 16:20:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fpu.c,v 1.19 2009/11/21 15:36:33 rmind Exp $ */
+/* $NetBSD: fpu.c,v 1.20 2010/03/16 16:20:19 skrll Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.19 2009/11/21 15:36:33 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.20 2010/03/16 16:20:19 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -81,7 +81,8 @@
paddr_t fpu_cur_uspace;
/* In locore.S, this swaps states in and out of the FPU. */
-void hppa_fpu_swap(struct pcb *, struct pcb *);
+void hppa_fpu_swapout(struct pcb *);
+void hppa_fpu_swap(struct fpreg *, struct fpreg *);
#ifdef FPEMUL
/*
@@ -228,7 +229,7 @@
return;
}
- hppa_fpu_swap(pcb, NULL);
+ hppa_fpu_swapout(pcb);
fpu_cur_uspace = 0;
}
@@ -339,7 +340,6 @@
error = (inst & OPCODE_STORE) ?
copyout(fpreg, (void *) offset, 1 << log2size) :
copyin((const void *) offset, fpreg, 1 << log2size);
- fdcache(HPPA_SID_KERNEL, (vaddr_t)fpreg, sizeof(pcb->pcb_fpregs));
return error;
}
@@ -445,7 +445,6 @@
ksi.ksi_addr = (void *)frame->tf_iioq_head;
trapsignal(l, &ksi);
}
- fdcache(HPPA_SID_KERNEL, (vaddr_t)fpregs, sizeof(pcb->pcb_fpregs));
}
#endif /* FPEMUL */
diff -r 5d9092429805 -r fccce8d8d318 sys/arch/hppa/hppa/hppa_machdep.c
--- a/sys/arch/hppa/hppa/hppa_machdep.c Tue Mar 16 15:49:58 2010 +0000
+++ b/sys/arch/hppa/hppa/hppa_machdep.c Tue Mar 16 16:20:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hppa_machdep.c,v 1.19 2010/01/16 13:29:47 skrll Exp $ */
+/* $NetBSD: hppa_machdep.c,v 1.20 2010/03/16 16:20:19 skrll Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.19 2010/01/16 13:29:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.20 2010/03/16 16:20:19 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -208,8 +208,6 @@
hppa_fpu_flush(l);
memcpy(&mcp->__fpregs, pcb->pcb_fpregs, sizeof(mcp->__fpregs));
- fdcache(HPPA_SID_KERNEL, (vaddr_t)pcb->pcb_fpregs,
- sizeof(pcb->pcb_fpregs));
*flags |= _UC_FPU;
}
@@ -320,8 +318,6 @@
hppa_fpu_flush(l);
memcpy(pcb->pcb_fpregs, &mcp->__fpregs, sizeof(mcp->__fpregs));
- fdcache(HPPA_SID_KERNEL, (vaddr_t)pcb->pcb_fpregs,
- sizeof(pcb->pcb_fpregs));
}
mutex_enter(p->p_lock);
diff -r 5d9092429805 -r fccce8d8d318 sys/arch/hppa/hppa/pmap.c
--- a/sys/arch/hppa/hppa/pmap.c Tue Mar 16 15:49:58 2010 +0000
+++ b/sys/arch/hppa/hppa/pmap.c Tue Mar 16 16:20:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.71 2010/03/13 16:17:59 skrll Exp $ */
+/* $NetBSD: pmap.c,v 1.72 2010/03/16 16:20:19 skrll Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.71 2010/03/13 16:17:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.72 2010/03/16 16:20:19 skrll Exp $");
#include "opt_cputype.h"
@@ -1685,8 +1685,6 @@
pa_space_t space = pmap->pm_space;
struct pcb *pcb = lwp_getpcb(l);
- KASSERT(pcb->pcb_uva == uvm_lwp_getuarea(l));
-
/* space is cached for the copy{in,out}'s pleasure */
pcb->pcb_space = space;
fdcache(HPPA_SID_KERNEL, (vaddr_t)pcb, sizeof(struct pcb));
diff -r 5d9092429805 -r fccce8d8d318 sys/arch/hppa/hppa/process_machdep.c
--- a/sys/arch/hppa/hppa/process_machdep.c Tue Mar 16 15:49:58 2010 +0000
+++ b/sys/arch/hppa/hppa/process_machdep.c Tue Mar 16 16:20:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: process_machdep.c,v 1.14 2009/11/21 15:36:33 rmind Exp $ */
+/* $NetBSD: process_machdep.c,v 1.15 2010/03/16 16:20:19 skrll Exp $ */
/* $OpenBSD: process_machdep.c,v 1.3 1999/06/18 05:19:52 mickey Exp $ */
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.14 2009/11/21 15:36:33 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.15 2010/03/16 16:20:19 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -113,7 +113,6 @@
hppa_fpu_flush(l);
memcpy(fpregs, pcb->pcb_fpregs, sizeof(*fpregs));
- fdcache(HPPA_SID_KERNEL, (vaddr_t)&pcb->pcb_fpregs, sizeof(*fpregs));
return 0;
}
@@ -178,7 +177,6 @@
hppa_fpu_flush(l);
memcpy(pcb->pcb_fpregs, fpregs, sizeof(*fpregs));
- fdcache(HPPA_SID_KERNEL, (vaddr_t)&pcb->pcb_fpregs, sizeof(*fpregs));
return 0;
}
diff -r 5d9092429805 -r fccce8d8d318 sys/arch/hppa/hppa/trap.S
--- a/sys/arch/hppa/hppa/trap.S Tue Mar 16 15:49:58 2010 +0000
+++ b/sys/arch/hppa/hppa/trap.S Tue Mar 16 16:20:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.S,v 1.46 2010/03/11 21:37:52 skrll Exp $ */
+/* $NetBSD: trap.S,v 1.47 2010/03/16 16:20:19 skrll Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -510,7 +510,7 @@
ldw TF_CR0(%sr3, %t3), %t1
mtctl %t1, %rctr
ldw TF_CR30(%sr3, %t3), %t1
- mtctl %t1, CR_UPADDR
+ mtctl %t1, CR_FPPADDR
/*
* Clear the system mask, this puts us back into physical mode. Reload
Home |
Main Index |
Thread Index |
Old Index