summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-01-12 19:19:35 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-01-12 19:19:35 +0000
commit0d4487fe419f565308ab5595eebcf02edc704636 (patch)
tree4a0fb7d80b0f4384eef3cbf1307111f8cb280d32
parent17ba040d4d84eab68168f731acdaadc98bf5b57a (diff)
Move kernel virtual address space to make sure it doesn't overlap with
physical memory to avoid problems on UltraSPARC-III and III+.
-rw-r--r--sys/arch/sparc64/include/vmparam.h5
-rw-r--r--sys/arch/sparc64/sparc64/pmap.c11
2 files changed, 11 insertions, 5 deletions
diff --git a/sys/arch/sparc64/include/vmparam.h b/sys/arch/sparc64/include/vmparam.h
index d7ffda068dc..4060b2d30ee 100644
--- a/sys/arch/sparc64/include/vmparam.h
+++ b/sys/arch/sparc64/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.14 2005/04/11 15:13:01 deraadt Exp $ */
+/* $OpenBSD: vmparam.h,v 1.15 2007/01/12 19:19:34 kettenis Exp $ */
/* $NetBSD: vmparam.h,v 1.18 2001/05/01 02:19:19 thorpej Exp $ */
/*
@@ -130,10 +130,9 @@
#define VM_MIN_ADDRESS ((vaddr_t)0)
#define VM_MAX_ADDRESS ((vaddr_t)-1)
#define VM_MAXUSER_ADDRESS ((vaddr_t)-1)
-#define VM_MAXUSER_ADDRESS32 ((vaddr_t)(0x00000000ffffffffL&~PGOFSET))
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)KERNBASE)
-#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)KERNEND)
+#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0x000007ffffffffffL)
#define VM_PHYSSEG_MAX 32 /* up to 32 segments */
#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c
index 188764c20b7..c24a6ffe362 100644
--- a/sys/arch/sparc64/sparc64/pmap.c
+++ b/sys/arch/sparc64/sparc64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.33 2007/01/06 21:08:07 kettenis Exp $ */
+/* $OpenBSD: pmap.c,v 1.34 2007/01/12 19:19:34 kettenis Exp $ */
/* $NetBSD: pmap.c,v 1.107 2001/08/31 16:47:41 eeh Exp $ */
#undef NO_VCACHE /* Don't forget the locked TLB in dostart */
/*
@@ -1536,6 +1536,9 @@ pmap_init()
vm_num_phys = avail_end - avail_start;
}
+/* Start of non-cachable physical memory on UltraSPARC-III. */
+#define VM_MAXPHYS_ADDRESS ((vaddr_t)0x0000040000000000L)
+
/*
* How much virtual space is available to the kernel?
*/
@@ -1545,8 +1548,12 @@ pmap_virtual_space(start, end)
vaddr_t *start, *end;
{
/*
- * Reserve one segment for kernel virtual memory
+ * Make sure virtual memory and physical memory don't overlap
+ * to avoid problems with ASI_PHYS_CACHED on UltraSPARC-III.
*/
+ if (vmmap < VM_MAXPHYS_ADDRESS)
+ vmmap = VM_MAXPHYS_ADDRESS;
+
/* Reserve two pages for pmap_copy_page && /dev/mem */
*start = kbreak = (vaddr_t)(vmmap + 2*NBPG);
*end = VM_MAX_KERNEL_ADDRESS;