summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-05-02 22:01:48 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-05-02 22:01:48 +0000
commitcd1ab31ea8de29fbe1aedad865b3dd09dfad134e (patch)
tree8628232a94cba95328b1acf6513ca48429e61b3f
parent5833cbf03dce94628ed0be9936c20981ec523b80 (diff)
Precompute the userland process apr cache bits into a global variable.
On AViiON systems with the 6:1 CMMU:CPU configuration, force cached mappings to be writethrough - this probably hides a bug in the code, but that's the only way so far to get such a system running stably.
-rw-r--r--sys/arch/aviion/aviion/m8820x.c12
-rw-r--r--sys/arch/m88k/include/pmap.h3
-rw-r--r--sys/arch/m88k/m88k/pmap.c12
3 files changed, 20 insertions, 7 deletions
diff --git a/sys/arch/aviion/aviion/m8820x.c b/sys/arch/aviion/aviion/m8820x.c
index 518bb28cf95..e52b9fabcdb 100644
--- a/sys/arch/aviion/aviion/m8820x.c
+++ b/sys/arch/aviion/aviion/m8820x.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m8820x.c,v 1.8 2010/04/25 21:03:51 miod Exp $ */
+/* $OpenBSD: m8820x.c,v 1.9 2010/05/02 22:01:43 miod Exp $ */
/*
* Copyright (c) 2004, 2006, 2010 Miodrag Vallat.
*
@@ -34,6 +34,7 @@
#include <machine/cmmu.h>
#include <machine/cpu.h>
#include <machine/m8820x.h>
+#include <machine/pmap.h>
#include <machine/prom.h>
extern u_int32_t pfsr_straight[];
@@ -152,6 +153,15 @@ hardprobe:
max_cmmus = ncpusfound << cmmu_shift;
scc.isplit = scc.dsplit = 0; /* XXX unknown */
m8820x_pfsr = pfsr_six;
+
+ /*
+ * We can't use writeback userland mappings until
+ * the CMMU split scheme is known, as the current
+ * pessimistic behaviour is not good enough to
+ * prevent out-of-sync cache lines from occuring.
+ */
+ default_apr |= CACHE_WT;
+
goto done;
break;
default:
diff --git a/sys/arch/m88k/include/pmap.h b/sys/arch/m88k/include/pmap.h
index 7561a9a5e78..f3a2b82e812 100644
--- a/sys/arch/m88k/include/pmap.h
+++ b/sys/arch/m88k/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.14 2009/05/02 14:32:27 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.15 2010/05/02 22:01:46 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1991 Carnegie Mellon University
@@ -48,6 +48,7 @@ typedef struct pv_entry *pv_entry_t;
extern pmap_t kernel_pmap;
extern struct pmap kernel_pmap_store;
extern caddr_t vmmap;
+extern apr_t default_apr;
#define pmap_kernel() (&kernel_pmap_store)
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
diff --git a/sys/arch/m88k/m88k/pmap.c b/sys/arch/m88k/m88k/pmap.c
index 4a90268a8d4..9d630d456d1 100644
--- a/sys/arch/m88k/m88k/pmap.c
+++ b/sys/arch/m88k/m88k/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.49 2009/09/27 19:16:10 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.50 2010/05/02 22:01:47 miod Exp $ */
/*
* Copyright (c) 2001-2004, Miodrag Vallat
* Copyright (c) 1998-2001 Steve Murphree, Jr.
@@ -115,6 +115,8 @@ pt_entry_t *vmpte, *msgbufmap;
struct pmap kernel_pmap_store;
pmap_t kernel_pmap = &kernel_pmap_store;
+apr_t default_apr = CACHE_GLOBAL | APR_V;
+
typedef struct kpdt_entry *kpdt_entry_t;
struct kpdt_entry {
kpdt_entry_t next;
@@ -751,12 +753,12 @@ pmap_bootstrap(vaddr_t load_start)
* Switch to using new page tables
*/
- kernel_pmap->pm_apr = (atop((paddr_t)kmap) << PG_SHIFT) |
- CACHE_GLOBAL | CACHE_WT | APR_V;
#if !defined(MULTIPROCESSOR) && defined(M88110)
if (CPU_IS88110)
- kernel_pmap->pm_apr &= ~CACHE_GLOBAL;
+ default_apr &= ~CACHE_GLOBAL;
#endif
+ kernel_pmap->pm_apr = (atop((paddr_t)kmap) << PG_SHIFT) | default_apr |
+ CACHE_WT;
pmap_bootstrap_cpu(cpu_number());
}
@@ -894,7 +896,7 @@ pmap_create(void)
if (pmap_extract(kernel_pmap, (vaddr_t)segdt,
(paddr_t *)&stpa) == FALSE)
panic("pmap_create: pmap_extract failed!");
- pmap->pm_apr = (atop(stpa) << PG_SHIFT) | CACHE_GLOBAL | APR_V;
+ pmap->pm_apr = (atop(stpa) << PG_SHIFT) | default_apr;
#if !defined(MULTIPROCESSOR) && defined(M88110)
if (CPU_IS88110)
pmap->pm_apr &= ~CACHE_GLOBAL;