summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/pcb.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-05-12 02:37:29 +0000
committerpeter <peter@FreeBSD.org>2003-05-12 02:37:29 +0000
commitc688fcc3ca312086f910aab7cdf045d92c0c364f (patch)
tree64ee040db2f5653c25d9bdeca46546a3cf5d954b /sys/amd64/include/pcb.h
parent6d94cd1e18844aefcc39c20d259853511b278015 (diff)
downloadFreeBSD-src-c688fcc3ca312086f910aab7cdf045d92c0c364f.zip
FreeBSD-src-c688fcc3ca312086f910aab7cdf045d92c0c364f.tar.gz
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/*)
Diffstat (limited to 'sys/amd64/include/pcb.h')
-rw-r--r--sys/amd64/include/pcb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/amd64/include/pcb.h b/sys/amd64/include/pcb.h
index 551bf8f..c17709b 100644
--- a/sys/amd64/include/pcb.h
+++ b/sys/amd64/include/pcb.h
@@ -57,6 +57,8 @@ struct pcb {
register_t pcb_rbx;
register_t pcb_rip;
register_t pcb_rflags;
+ register_t pcb_fsbase;
+ register_t pcb_gsbase;
struct savefpu pcb_save;
u_long pcb_flags;
OpenPOWER on IntegriCloud