summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/cpu_switch.S
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/amd64/cpu_switch.S
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/amd64/cpu_switch.S')
-rw-r--r--sys/amd64/amd64/cpu_switch.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S
index a0b11f8..99d6716 100644
--- a/sys/amd64/amd64/cpu_switch.S
+++ b/sys/amd64/amd64/cpu_switch.S
@@ -266,7 +266,7 @@ store_seg:
movl %es,PCB_ES(%r8)
movl %fs,PCB_FS(%r8)
jmp done_store_seg
-2: movq PCB_GS32P(%r8),%rax
+2: movq PCPU(GS32P),%rax
movq (%rax),%rax
movq %rax,PCB_GS32SD(%r8)
jmp 1b
@@ -283,7 +283,7 @@ load_seg:
movl PCB_FS(%r8),%fs
jmp done_load_seg
/* Restore userland %gs while preserving kernel gsbase */
-2: movq PCB_GS32P(%r8),%rax
+2: movq PCPU(GS32P),%rax
movq PCB_GS32SD(%r8),%rcx
movq %rcx,(%rax)
jmp 1b
OpenPOWER on IntegriCloud