summaryrefslogtreecommitdiffstats
path: root/sys/amd64/linux32
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-09-08 09:59:05 +0000
committerkib <kib@FreeBSD.org>2008-09-08 09:59:05 +0000
commitf444f744fafc9bc80a33a896317d5b48cbaf83da (patch)
treea308fa38f71a058e176d9756194177e9afdf880e /sys/amd64/linux32
parent73306a54357999dd00f201e861f8ee335a59a421 (diff)
downloadFreeBSD-src-f444f744fafc9bc80a33a896317d5b48cbaf83da.zip
FreeBSD-src-f444f744fafc9bc80a33a896317d5b48cbaf83da.tar.gz
The pcb_gs32p should be per-cpu, not per-thread pointer. This is
location in GDT where the segment descriptor from pcb_gs32sd is copied, and the location is in GDT local to CPU. Noted and reviewed by: peter MFC after: 1 week
Diffstat (limited to 'sys/amd64/linux32')
-rw-r--r--sys/amd64/linux32/linux32_machdep.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c
index ceba561..aecf869 100644
--- a/sys/amd64/linux32/linux32_machdep.c
+++ b/sys/amd64/linux32/linux32_machdep.c
@@ -694,7 +694,6 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
#endif
td2->td_pcb->pcb_gsbase = (register_t)info.base_addr;
td2->td_pcb->pcb_gs32sd = sd;
- td2->td_pcb->pcb_gs32p = &gdt[GUGS32_SEL];
td2->td_pcb->pcb_gs = GSEL(GUGS32_SEL, SEL_UPL);
td2->td_pcb->pcb_flags |= PCB_GS32BIT | PCB_32BIT;
}
@@ -1352,8 +1351,7 @@ linux_set_thread_area(struct thread *td,
critical_enter();
td->td_pcb->pcb_gsbase = (register_t)info.base_addr;
- td->td_pcb->pcb_gs32sd = gdt[GUGS32_SEL] = sd;
- td->td_pcb->pcb_gs32p = &gdt[GUGS32_SEL];
+ td->td_pcb->pcb_gs32sd = *PCPU_GET(gs32p) = sd;
td->td_pcb->pcb_flags |= PCB_32BIT | PCB_GS32BIT;
wrmsr(MSR_KGSBASE, td->td_pcb->pcb_gsbase);
critical_exit();
OpenPOWER on IntegriCloud