commit 49c543039050ba85e22f65b719e958a81f4c9c1f Author: Kostik I. Belousov Date: Sat Aug 30 21:33:59 2008 +0300 After reloading %fs, put new fsbase into %r9. This shall allow the later code to compare new pcb_fsbase with the actual hw value and make a right decision. diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S index f34b0cc..9e13ef4 100644 --- a/sys/amd64/amd64/cpu_switch.S +++ b/sys/amd64/amd64/cpu_switch.S @@ -265,6 +265,10 @@ load_seg: movl PCB_DS(%r8),%ds movl PCB_ES(%r8),%es movl PCB_FS(%r8),%fs + movl $MSR_FSBASE,%ecx + rdmsr + shlq $32,%rdx + leaq (%rax,%rdx),%r9 jmp done_load_seg /* Restore userland %gs while preserving kernel gsbase */ 2: movq PCB_GS32P(%r8),%rax