summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/pcpu.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2005-04-13 22:57:17 +0000
committerpeter <peter@FreeBSD.org>2005-04-13 22:57:17 +0000
commit7bc6e7456ed8293645768a1f7523c733ff0c00d7 (patch)
treeaf5fd1903b9a4515ee70a0ddf85c5cd059996ab4 /sys/i386/include/pcpu.h
parent47cf7426fa7b813ccf8268451588946defa747c2 (diff)
downloadFreeBSD-src-7bc6e7456ed8293645768a1f7523c733ff0c00d7.zip
FreeBSD-src-7bc6e7456ed8293645768a1f7523c733ff0c00d7.tar.gz
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.
Diffstat (limited to 'sys/i386/include/pcpu.h')
-rw-r--r--sys/i386/include/pcpu.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h
index f371e39..6312b97 100644
--- a/sys/i386/include/pcpu.h
+++ b/sys/i386/include/pcpu.h
@@ -51,6 +51,7 @@
struct i386tss pc_common_tss; \
struct segment_descriptor pc_common_tssd; \
struct segment_descriptor *pc_tss_gdt; \
+ struct segment_descriptor *pc_fsgs_gdt; \
int pc_currentldt; \
u_int pc_acpi_id; \
u_int pc_apic_id
OpenPOWER on IntegriCloud