Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Apr 2005 22:57:17 +0000 (UTC)
From:      Peter Wemm <peter@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/i386/i386 genassym.c machdep.c mp_machdep.c swtch.s sys_machdep.c src/sys/i386/include pcb.h pcpu.h segments.h sysarch.h
Message-ID:  <200504132257.j3DMvHha095246@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
peter       2005-04-13 22:57:17 UTC

  FreeBSD src repository

  Modified files:
    sys/i386/i386        genassym.c machdep.c mp_machdep.c swtch.s 
                         sys_machdep.c 
    sys/i386/include     pcb.h pcpu.h segments.h sysarch.h 
  Log:
  Change the segment limits to 4GB, we set the user accessible bit on all
  of the kernel address space already.  Intel recommend this anyway, because
  using a non-4GB limit adds an additional clock cycle to address generation.
  We were able to install 4GB segments into the LDT, so any limits we imposed
  on %cs and %ds were academic anyway.  More importantly, this allows us to
  make a page in the kernel readable to user applications, for holding things
  like the signal trampoline and other fun things.
  
  Move the user %cs/%ds segments from the LDT to the GDT.  There was no good
  reason for them to be there anyway.  The old LDT entries are still there
  but we can now relax the restriction that prevented users from emptying
  the default LDT entries.
  
  Putting user and kernel %cs and %ds together allows us to access the fast
  sysenter/sysexit/syscall/sysret instructions.  syscall/sysret in particular
  require that the user/kernel segments be laid out this way.  Reserve a slot
  specifically for NDIS while here.
  
  Create two user controllable slots in the GDT that are context switched
  with the (kernel) thread.  This allows user applications to set two
  user privilige selectors to arbitary values.  Create
  i386_set_fsbase(void *base) and friends. (get/set, fs/gs).  For i386,
  %gs is used by tls and the thread libraries and this means that user
  processes no longer have to have the cost of having a custom LDT, and
  we will no longer to do a ldt switch when activating a kthread/ithread in
  the usual case any more.
  
  In other words, we can now set the base address for %fs and %gs to arbitary
  addresses without the pain of messing with ldt segments.
  
  Revision  Changes    Path
  1.151     +2 -0      src/sys/i386/i386/genassym.c
  1.612     +88 -50    src/sys/i386/i386/machdep.c
  1.246     +2 -0      src/sys/i386/i386/mp_machdep.c
  1.148     +14 -2     src/sys/i386/i386/swtch.s
  1.97      +63 -0     src/sys/i386/i386/sys_machdep.c
  1.54      +2 -0      src/sys/i386/include/pcb.h
  1.44      +1 -0      src/sys/i386/include/pcpu.h
  1.38      +20 -14    src/sys/i386/include/segments.h
  1.23      +8 -0      src/sys/i386/include/sysarch.h



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504132257.j3DMvHha095246>