summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-06-24 21:24:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-06-24 21:24:04 +0000
commiteb30d8959a1448ff7a7b73c410533fd80508f0af (patch)
treecfc8de5d0358f7748bb5089529c342104180deba /sys/arch
parent3adb826ceb6fc3ab73eae18d801296aaefa6c8aa (diff)
On user/kernel shared page table machines, do not let processes map their
own page 0, as discussed with miod (and many others previously, including art and toby). On sparc, make this __LDPGSZ because PAGE_SIZE is non-constant ok miod tedu
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/include/vmparam.h4
-rw-r--r--sys/arch/amd64/include/vmparam.h4
-rw-r--r--sys/arch/arm/include/vmparam.h4
-rw-r--r--sys/arch/i386/include/vmparam.h4
-rw-r--r--sys/arch/sh/include/vmparam.h4
-rw-r--r--sys/arch/sh/sh/trap.c4
-rw-r--r--sys/arch/sparc/include/vmparam.h4
-rw-r--r--sys/arch/vax/include/vmparam.h4
8 files changed, 16 insertions, 16 deletions
diff --git a/sys/arch/alpha/include/vmparam.h b/sys/arch/alpha/include/vmparam.h
index ffe2b94cfd7..8febfdf5fdb 100644
--- a/sys/arch/alpha/include/vmparam.h
+++ b/sys/arch/alpha/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.14 2005/04/11 15:12:59 deraadt Exp $ */
+/* $OpenBSD: vmparam.h,v 1.15 2008/06/24 21:24:01 deraadt Exp $ */
/* $NetBSD: vmparam.h,v 1.18 2000/05/22 17:13:54 thorpej Exp $ */
/*
@@ -102,7 +102,7 @@
*/
/* user/kernel map constants */
-#define VM_MIN_ADDRESS ((vaddr_t)ALPHA_USEG_BASE) /* 0 */
+#define VM_MIN_ADDRESS ((vaddr_t)PAGE_SIZE)
#define VM_MAXUSER_ADDRESS ((vaddr_t)(ALPHA_USEG_END + 1L)) /* 4T */
#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)ALPHA_K1SEG_BASE)
diff --git a/sys/arch/amd64/include/vmparam.h b/sys/arch/amd64/include/vmparam.h
index c083cb68e23..3822f13d557 100644
--- a/sys/arch/amd64/include/vmparam.h
+++ b/sys/arch/amd64/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.8 2008/06/10 02:55:39 weingart Exp $ */
+/* $OpenBSD: vmparam.h,v 1.9 2008/06/24 21:24:03 deraadt Exp $ */
/* $NetBSD: vmparam.h,v 1.1 2003/04/26 18:39:49 fvdl Exp $ */
/*-
@@ -88,7 +88,7 @@
*/
/* user/kernel map constants */
-#define VM_MIN_ADDRESS 0
+#define VM_MIN_ADDRESS PAGE_SIZE
#define VM_MAXUSER_ADDRESS 0x00007f7fffffc000
#define VM_MAX_ADDRESS 0x00007fbfdfeff000
#define VM_MIN_KERNEL_ADDRESS 0xffff800000000000
diff --git a/sys/arch/arm/include/vmparam.h b/sys/arch/arm/include/vmparam.h
index dfce524efa1..cfb23f6bdc4 100644
--- a/sys/arch/arm/include/vmparam.h
+++ b/sys/arch/arm/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.3 2005/04/11 15:13:01 deraadt Exp $ */
+/* $OpenBSD: vmparam.h,v 1.4 2008/06/24 21:24:03 deraadt Exp $ */
/* $NetBSD: vmparam.h,v 1.18 2003/05/21 18:04:44 thorpej Exp $ */
/*
@@ -91,7 +91,7 @@
/*
* Mach derived constants
*/
-#define VM_MIN_ADDRESS ((vaddr_t) 0x00001000)
+#define VM_MIN_ADDRESS ((vaddr_t) PAGE_SIZE)
#define VM_MAXUSER_ADDRESS ((vaddr_t) ARM_KERNEL_BASE)
#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS
diff --git a/sys/arch/i386/include/vmparam.h b/sys/arch/i386/include/vmparam.h
index 4e1e7ed7ef2..e871997fd43 100644
--- a/sys/arch/i386/include/vmparam.h
+++ b/sys/arch/i386/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.39 2007/06/01 18:57:02 miod Exp $ */
+/* $OpenBSD: vmparam.h,v 1.40 2008/06/24 21:24:03 deraadt Exp $ */
/* $NetBSD: vmparam.h,v 1.15 1994/10/27 04:16:34 cgd Exp $ */
/*-
@@ -96,7 +96,7 @@
#define DEADBEEF1 0xefffaabb /* pool's filler */
/* user/kernel map constants */
-#define VM_MIN_ADDRESS ((vaddr_t)0)
+#define VM_MIN_ADDRESS ((vaddr_t)PAGE_SIZE)
#define VM_MAXUSER_ADDRESS ((vaddr_t)((PDSLOT_PTE<<PDSHIFT) - USPACE))
#define VM_MAX_ADDRESS ((vaddr_t)((PDSLOT_PTE<<PDSHIFT) + \
(PDSLOT_PTE<<PGSHIFT)))
diff --git a/sys/arch/sh/include/vmparam.h b/sys/arch/sh/include/vmparam.h
index 4269cdbb5f6..4ba9a536bc4 100644
--- a/sys/arch/sh/include/vmparam.h
+++ b/sys/arch/sh/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.4 2007/09/02 21:18:08 hshoexer Exp $ */
+/* $OpenBSD: vmparam.h,v 1.5 2008/06/24 21:24:03 deraadt Exp $ */
/* $NetBSD: vmparam.h,v 1.17 2006/03/04 01:55:03 uwe Exp $ */
/*-
@@ -42,7 +42,7 @@
#include <sys/queue.h>
/* Virtual address map. */
-#define VM_MIN_ADDRESS ((vaddr_t)0)
+#define VM_MIN_ADDRESS ((vaddr_t)PAGE_SIZE)
#define VM_MAXUSER_ADDRESS ((vaddr_t)0x7ffff000)
#define VM_MAX_ADDRESS ((vaddr_t)0x7ffff000)
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)0xc0000000)
diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c
index d5b503d17c3..beb89c031ee 100644
--- a/sys/arch/sh/sh/trap.c
+++ b/sys/arch/sh/sh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.12 2007/03/15 10:22:29 art Exp $ */
+/* $OpenBSD: trap.c,v 1.13 2008/06/24 21:24:03 deraadt Exp $ */
/* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */
/* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */
@@ -510,7 +510,7 @@ cachectl(struct proc *p, struct trapframe *tf)
va = (vaddr_t)tf->tf_r4;
len = (vsize_t)tf->tf_r5;
- if (/* va < VM_MIN_ADDRESS || */ va >= VM_MAXUSER_ADDRESS ||
+ if (va < VM_MIN_ADDRESS || va >= VM_MAXUSER_ADDRESS ||
va + len <= va || va + len >= VM_MAXUSER_ADDRESS)
len = 0;
diff --git a/sys/arch/sparc/include/vmparam.h b/sys/arch/sparc/include/vmparam.h
index 8557ec3fb71..e527985d3bc 100644
--- a/sys/arch/sparc/include/vmparam.h
+++ b/sys/arch/sparc/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.31 2005/04/17 18:47:48 miod Exp $ */
+/* $OpenBSD: vmparam.h,v 1.32 2008/06/24 21:24:03 deraadt Exp $ */
/* $NetBSD: vmparam.h,v 1.13 1997/07/12 16:20:03 perry Exp $ */
/*
@@ -89,7 +89,7 @@
* IO space virtual base, which must be the same as VM_MAX_KERNEL_ADDRESS:
* tread with care.
*/
-#define VM_MIN_ADDRESS ((vaddr_t)0)
+#define VM_MIN_ADDRESS ((vaddr_t)__LDPGSZ)
#define VM_MAX_ADDRESS ((vaddr_t)VM_MIN_KERNEL_ADDRESS)
#define VM_MAXUSER_ADDRESS ((vaddr_t)VM_MIN_KERNEL_ADDRESS)
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)KERNBASE)
diff --git a/sys/arch/vax/include/vmparam.h b/sys/arch/vax/include/vmparam.h
index 440163d5ce0..40e41933392 100644
--- a/sys/arch/vax/include/vmparam.h
+++ b/sys/arch/vax/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.28 2007/04/22 10:05:51 miod Exp $ */
+/* $OpenBSD: vmparam.h,v 1.29 2008/06/24 21:24:03 deraadt Exp $ */
/* $NetBSD: vmparam.h,v 1.32 2000/03/07 00:05:59 matt Exp $ */
/*-
@@ -97,7 +97,7 @@
#define vax_trunc_page(x) ((vaddr_t)(x) & ~VAX_PGOFSET)
/* user/kernel map constants */
-#define VM_MIN_ADDRESS ((vaddr_t)0)
+#define VM_MIN_ADDRESS ((vaddr_t)PAGE_SIZE)
#define VM_MAXUSER_ADDRESS ((vaddr_t)KERNBASE)
#define VM_MAX_ADDRESS ((vaddr_t)KERNBASE)
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)KERNBASE)