aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2001-08-23 01:25:21 +0000
committerPeter Wemm <peter@FreeBSD.org>2001-08-23 01:25:21 +0000
commit9f9360003f29686af25b3b4b27a3d2377fec8f53 (patch)
tree460ef858efbc27c45b6a522a625f76e973eb216b /sys
parent1ef4734b8af76d56cdb9073eb0c82e1fe62cc382 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/machdep.c18
-rw-r--r--sys/i386/i386/machdep.c18
2 files changed, 4 insertions, 32 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 95216bc4a7e44..36ea8e606bea8 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1875,25 +1875,11 @@ init386(first)
/* make ldt memory segments */
/*
- * The data segment limit must not cover the user area because we
- * don't want the user area to be writable in copyout() etc. (page
- * level protection is lost in kernel mode on 386's). Also, we
- * don't want the user area to be writable directly (page level
- * protection of the user area is not available on 486's with
- * CR0_WP set, because there is no user-read/kernel-write mode).
- *
* XXX - VM_MAXUSER_ADDRESS is an end address, not a max. And it
* should be spelled ...MAX_USER...
*/
-#define VM_END_USER_RW_ADDRESS VM_MAXUSER_ADDRESS
- /*
- * The code segment limit has to cover the user area until we move
- * the signal trampoline out of the user area. This is safe because
- * the code segment cannot be written to directly.
- */
-#define VM_END_USER_R_ADDRESS (VM_END_USER_RW_ADDRESS + UPAGES * PAGE_SIZE)
- ldt_segs[LUCODE_SEL].ssd_limit = atop(VM_END_USER_R_ADDRESS - 1);
- ldt_segs[LUDATA_SEL].ssd_limit = atop(VM_END_USER_RW_ADDRESS - 1);
+ ldt_segs[LUCODE_SEL].ssd_limit = atop(VM_MAXUSER_ADDRESS - 1);
+ ldt_segs[LUDATA_SEL].ssd_limit = atop(VM_MAXUSER_ADDRESS - 1);
for (x = 0; x < sizeof ldt_segs / sizeof ldt_segs[0]; x++)
ssdtosd(&ldt_segs[x], &ldt[x].sd);
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 95216bc4a7e44..36ea8e606bea8 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -1875,25 +1875,11 @@ init386(first)
/* make ldt memory segments */
/*
- * The data segment limit must not cover the user area because we
- * don't want the user area to be writable in copyout() etc. (page
- * level protection is lost in kernel mode on 386's). Also, we
- * don't want the user area to be writable directly (page level
- * protection of the user area is not available on 486's with
- * CR0_WP set, because there is no user-read/kernel-write mode).
- *
* XXX - VM_MAXUSER_ADDRESS is an end address, not a max. And it
* should be spelled ...MAX_USER...
*/
-#define VM_END_USER_RW_ADDRESS VM_MAXUSER_ADDRESS
- /*
- * The code segment limit has to cover the user area until we move
- * the signal trampoline out of the user area. This is safe because
- * the code segment cannot be written to directly.
- */
-#define VM_END_USER_R_ADDRESS (VM_END_USER_RW_ADDRESS + UPAGES * PAGE_SIZE)
- ldt_segs[LUCODE_SEL].ssd_limit = atop(VM_END_USER_R_ADDRESS - 1);
- ldt_segs[LUDATA_SEL].ssd_limit = atop(VM_END_USER_RW_ADDRESS - 1);
+ ldt_segs[LUCODE_SEL].ssd_limit = atop(VM_MAXUSER_ADDRESS - 1);
+ ldt_segs[LUDATA_SEL].ssd_limit = atop(VM_MAXUSER_ADDRESS - 1);
for (x = 0; x < sizeof ldt_segs / sizeof ldt_segs[0]; x++)
ssdtosd(&ldt_segs[x], &ldt[x].sd);