summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2009-01-17 23:44:47 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2009-01-17 23:44:47 +0000
commit192d0dca46e0e909f463e26cd6e473d578cc064d (patch)
tree9e17e2b6e949984975e917760cfae7147d0c31cf
parentbd5c137a17928fbc850340bcc7a9f650136d6dba (diff)
gdt_compact() was removed years ago, so kill the code and comments
that worked around its presence ok'ed by miod@
-rw-r--r--sys/arch/amd64/amd64/gdt.c7
-rw-r--r--sys/arch/amd64/amd64/vm_machdep.c11
-rw-r--r--sys/arch/i386/i386/locore.s21
-rw-r--r--sys/arch/i386/i386/vm_machdep.c11
4 files changed, 7 insertions, 43 deletions
diff --git a/sys/arch/amd64/amd64/gdt.c b/sys/arch/amd64/amd64/gdt.c
index 0f178eede25..1f36bcfdb4b 100644
--- a/sys/arch/amd64/amd64/gdt.c
+++ b/sys/arch/amd64/amd64/gdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gdt.c,v 1.12 2008/07/25 15:01:33 art Exp $ */
+/* $OpenBSD: gdt.c,v 1.13 2009/01/17 23:44:46 guenther Exp $ */
/* $NetBSD: gdt.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*-
@@ -65,11 +65,6 @@ void gdt_put_slot(int);
/*
* Lock and unlock the GDT, to avoid races in case gdt_{ge,pu}t_slot() sleep
* waiting for memory.
- *
- * Note that the locking done here is not sufficient for multiprocessor
- * systems. A freshly allocated slot will still be of type SDT_SYSNULL for
- * some time after the GDT is unlocked, so gdt_compact() could attempt to
- * reclaim it.
*/
static __inline void
gdt_lock(void)
diff --git a/sys/arch/amd64/amd64/vm_machdep.c b/sys/arch/amd64/amd64/vm_machdep.c
index 178a5c49d05..3db4a1495d1 100644
--- a/sys/arch/amd64/amd64/vm_machdep.c
+++ b/sys/arch/amd64/amd64/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.12 2007/10/13 07:18:32 miod Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.13 2009/01/17 23:44:46 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.1 2003/04/26 18:39:33 fvdl Exp $ */
/*-
@@ -107,15 +107,6 @@ cpu_fork(struct proc *p1, struct proc *p2, void *stack, size_t stacksize,
*pcb = p1->p_addr->u_pcb;
/*
- * Preset these so that gdt_compact() doesn't get confused if called
- * during the allocations below.
- *
- * Note: pcb_ldt_sel is handled in the pmap_activate() call when
- * we run the new process.
- */
- p2->p_md.md_tss_sel = GSEL(GNULL_SEL, SEL_KPL);
-
- /*
* Activate the address space. Note this will refresh pcb_ldt_sel.
*/
pmap_activate(p2);
diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s
index a3acaa09e56..3e884db386a 100644
--- a/sys/arch/i386/i386/locore.s
+++ b/sys/arch/i386/i386/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.124 2008/07/28 19:08:46 miod Exp $ */
+/* $OpenBSD: locore.s,v 1.125 2009/01/17 23:44:46 guenther Exp $ */
/* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */
/*-
@@ -1359,10 +1359,9 @@ switch_exited:
movl PCB_EBP(%esi),%ebp
/*
- * Activate the address space. We're curproc, so %cr3 will
- * be reloaded, but we're not yet curpcb, so the LDT won't
- * be reloaded, although the PCB copy of the selector will
- * be refreshed from the pmap.
+ * Activate the address space. The pcb copy of %cr3 and the
+ * LDT will be refreshed from the pmap, and because we're
+ * curproc they'll both be reloaded into the CPU.
*/
pushl %edi
call _C_LABEL(pmap_activate)
@@ -1376,18 +1375,6 @@ switch_exited:
andl $~0x0200,4-SEL_KPL(%eax,%edx,1)
ltr %dx
-#ifdef USER_LDT
- /*
- * Switch LDT.
- *
- * XXX
- * Always do this, because the LDT could have been swapped into a
- * different selector after a process exited. (See gdt_compact().)
- */
- movl PCB_LDT_SEL(%esi),%edx
- lldt %dx
-#endif /* USER_LDT */
-
/* Restore cr0 (including FPU state). */
movl PCB_CR0(%esi),%ecx
#ifdef MULTIPROCESSOR
diff --git a/sys/arch/i386/i386/vm_machdep.c b/sys/arch/i386/i386/vm_machdep.c
index 3e009a73ca7..acad8e49e34 100644
--- a/sys/arch/i386/i386/vm_machdep.c
+++ b/sys/arch/i386/i386/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.54 2007/10/13 07:18:32 miod Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.55 2009/01/17 23:44:46 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.61 1996/05/03 19:42:35 christos Exp $ */
/*-
@@ -97,15 +97,6 @@ cpu_fork(struct proc *p1, struct proc *p2, void *stack, size_t stacksize,
#endif
*pcb = p1->p_addr->u_pcb;
- /*
- * Preset these so that gdt_compact() doesn't get confused if called
- * during the allocations below.
- *
- * Note: pcb_ldt_sel is handled in the pmap_activate() call when
- * we run the new process.
- */
- p2->p_md.md_tss_sel = GSEL(GNULL_SEL, SEL_KPL);
-
/* Fix up the TSS. */
pcb->pcb_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
pcb->pcb_tss.tss_esp0 = (int)p2->p_addr + USPACE - 16;