summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-10-04 02:45:01 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-17 23:50:19 +0200
commite6a314ad454d7f4c07ba61436a320a9c919e050a (patch)
treea18780ece1bcb8ddfe1a75f1433a120d7e12398e
parentf54227c580be1552979622dd7e590cbf3ae328f0 (diff)
2002-10-03 Roland McGrath <roland@frob.com>
Remove magic %gs:0 pseudo-register support. * i386/i386/ldt.h (USER_GS): Macro removed. * i386/i386/pcb.c (pcb_init): Set gs to USER_DS, not USER_GS. (thread_setstatus): Likewise. * i386/i386/mp_desc.h (struct mp_desc_table): Remove member `user_thread_register'. * i386/i386/thread.h (struct i386_machine_state): Likewise. * i386/i386/mp_desc.c (mp_desc_init): Don't set up USER_GS in LDT. * i386/i386/ldt.c (ldt_init): Likewise. * i386/intel/pmap.c (pmap_bootstrap): Don't give users access to direct-mapped pages. * i386/i386/user_ldt.c (i386_set_ldt): Don't cap segment limits.
-rw-r--r--i386/i386/ldt.c4
-rw-r--r--i386/i386/ldt.h1
-rw-r--r--i386/i386/mp_desc.h1
-rw-r--r--i386/intel/pmap.c12
4 files changed, 3 insertions, 15 deletions
diff --git a/i386/i386/ldt.c b/i386/i386/ldt.c
index 8e492fdb..397b9483 100644
--- a/i386/i386/ldt.c
+++ b/i386/i386/ldt.c
@@ -36,7 +36,6 @@
extern int syscall();
struct x86_desc ldt[LDTSZ];
-extern natural_t user_thread_register;
void
ldt_init()
@@ -60,9 +59,6 @@ ldt_init()
VM_MAX_ADDRESS-VM_MIN_ADDRESS-4096,
ACC_PL_U|ACC_DATA_W, SZ_32);
- fill_ldt_descriptor(USER_GS, kvtolin(&user_thread_register),
- 3, ACC_PL_U|ACC_DATA_W, SZ_32);
-
/* Activate the LDT. */
set_ldt(KERNEL_LDT);
}
diff --git a/i386/i386/ldt.h b/i386/i386/ldt.h
index 927e128d..4816f610 100644
--- a/i386/i386/ldt.h
+++ b/i386/i386/ldt.h
@@ -45,7 +45,6 @@
#define USER_SCALL 0x07 /* system call gate */
#define USER_CS 0x17 /* user code segment */
#define USER_DS 0x1f /* user data segment */
-#define USER_GS 0x0f /* user thread register segment */
#define LDTSZ 4
diff --git a/i386/i386/mp_desc.h b/i386/i386/mp_desc.h
index 7943b1e2..4db69c01 100644
--- a/i386/i386/mp_desc.h
+++ b/i386/i386/mp_desc.h
@@ -54,7 +54,6 @@
*/
struct mp_desc_table {
int cpu_number; /* to be fetched via %gs */
- natural_t user_thread_register; /* USER_GS:0 points here */
struct x86_gate idt[IDTSZ]; /* IDT */
struct x86_desc gdt[GDTSZ]; /* GDT */
struct x86_desc ldt[LDTSZ]; /* LDT */
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
index d54a906c..3c5a87d3 100644
--- a/i386/intel/pmap.c
+++ b/i386/intel/pmap.c
@@ -697,15 +697,10 @@ void pmap_bootstrap()
pt_entry_t *pte;
vm_offset_t pteva;
- /* Initialize the page directory entry. We give
- user-mode access to everything because it will
- be constrained by the segmentation. This allows
- special-purpose segments to be set up by kernel
- code to allow user access to specific locations
- above VM_MAX_ADDRESS. */
+ /* Initialize the page directory entry. */
*pde = (pa_to_pte((vm_offset_t)ptable)
| INTEL_PTE_VALID | INTEL_PTE_WRITE
- | INTEL_PTE_USER | kernel_pte_global);
+ | kernel_pte_global);
/* Initialize the page table. */
for (pte = ptable; (va < phys_mem_max) && (pte < ptable+NPTES); pte++)
@@ -720,8 +715,7 @@ void pmap_bootstrap()
entry |= pa_to_pte(va) | INTEL_PTE_VALID;
if ((va < (vm_offset_t)_start)
|| (va + INTEL_PGBYTES > (vm_offset_t)etext))
- /* See comment above about user access. */
- entry |= INTEL_PTE_WRITE | INTEL_PTE_USER;
+ entry |= INTEL_PTE_WRITE;
va += INTEL_PGBYTES;
}
WRITE_PTE_FAST(pte, entry);