freebsd-skq/sys/amd64/isa
peter c688fcc3ca Give a %fs and %gs to userland. Use swapgs to obtain the kernel %GS.base
value on entry and exit.  This isn't as easy as it sounds because when
we recursively trap or interrupt, we have to avoid duplicating the
swapgs instruction or we end up back with the userland %gs.  I implemented
this by testing TF_CS to see if we're coming from supervisor mode
already, and check for returning to supervisor. To avoid a race with
interrupts in the brief period after beginning executing the handler and
before the swapgs, convert all trap gates to interrupt gates, and reenable
interrupts immediately after the swapgs.  I am not happy with this.
There are other possible ways to do this that should be investigated.
(eg: storing the GS.base MSR value in the trapframe)

Add some sysarch functions to let the userland code get to this.

Approved by:	re (blanket amd64/*)
2003-05-12 02:37:29 +00:00
..
atpic_vector.S Move ICU_* defines into icu.h. 2002-04-06 08:25:05 +00:00
clock.c Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
icu_ipl.S Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
icu_vector.S Give a %fs and %gs to userland. Use swapgs to obtain the kernel %GS.base 2003-05-12 02:37:29 +00:00
icu.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
intr_machdep.c Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
intr_machdep.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
isa_dma.c Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
isa_dma.h Remove __P. 2002-03-20 07:51:46 +00:00
isa.c Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
isa.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
ithread.c Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
nmi.c Style nits. 2003-05-07 17:21:38 +00:00
npx.c Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
timerreg.h Commit MD parts of a loosely functional AMD64 port. This is based on 2003-05-01 01:05:25 +00:00
vector.S Repocopy *.s to *.S 2003-05-03 00:21:43 +00:00