Date: Wed, 14 May 2003 15:13:39 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 31200 for review Message-ID: <200305142213.h4EMDd37062540@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=31200 Change 31200 by peter@peter_hammer on 2003/05/14 15:13:01 Dig out of a hole. Dont context switch the kernel gsbase. Just preserve it across %gs loads, thats all we need. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/cpu_switch.S#6 edit .. //depot/projects/hammer/sys/amd64/amd64/genassym.c#16 edit .. //depot/projects/hammer/sys/amd64/amd64/machdep.c#36 edit .. //depot/projects/hammer/sys/amd64/ia32/ia32_sysvec.c#7 edit .. //depot/projects/hammer/sys/amd64/include/pcb.h#10 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/cpu_switch.S#6 (text+ko) ==== @@ -106,12 +106,6 @@ pushfq /* PSL */ popq PCB_RFLAGS(%r8) - /* Save kernel %gs.base */ - movl $MSR_GSBASE,%ecx - rdmsr - movl %eax,PCB_KGSBASE(%r8) - movl %edx,PCB_KGSBASE+4(%r8) - /* Save userland %fs */ movl $MSR_FSBASE,%ecx rdmsr @@ -176,12 +170,11 @@ movl PCB_DS(%r8),%ds movl PCB_ES(%r8),%es movl PCB_FS(%r8),%fs - movl PCB_GS(%r8),%gs - /* Restore kernel %gs.base */ + /* Restore userland %gs while preserving kernel gsbase */ movl $MSR_GSBASE,%ecx - movl PCB_KGSBASE(%r8),%eax - movl PCB_KGSBASE+4(%r8),%edx + rdmsr + movl PCB_GS(%r8),%gs wrmsr /* Restore userland %fs */ ==== //depot/projects/hammer/sys/amd64/amd64/genassym.c#16 (text+ko) ==== @@ -125,7 +125,6 @@ ASSYM(PCB_RFLAGS, offsetof(struct pcb, pcb_rflags)); ASSYM(PCB_FSBASE, offsetof(struct pcb, pcb_fsbase)); ASSYM(PCB_GSBASE, offsetof(struct pcb, pcb_gsbase)); -ASSYM(PCB_KGSBASE, offsetof(struct pcb, pcb_kgsbase)); ASSYM(PCB_DS, offsetof(struct pcb, pcb_ds)); ASSYM(PCB_ES, offsetof(struct pcb, pcb_es)); ASSYM(PCB_FS, offsetof(struct pcb, pcb_fs)); ==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#36 (text+ko) ==== @@ -481,7 +481,6 @@ wrmsr(MSR_KGSBASE, 0); /* User value while we're in the kernel */ pcb->pcb_fsbase = 0; pcb->pcb_gsbase = 0; - pcb->pcb_kgsbase = rdmsr(MSR_GSBASE); load_ds(_udatasel); load_es(_udatasel); load_fs(_udatasel); @@ -1312,7 +1311,6 @@ /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; /* XXXKSE */ thread0.td_pcb->pcb_cr3 = IdlePML4; - thread0.td_pcb->pcb_kgsbase = (u_int64_t)pc; thread0.td_frame = &proc0_tf; } ==== //depot/projects/hammer/sys/amd64/ia32/ia32_sysvec.c#7 (text+ko) ==== @@ -246,7 +246,6 @@ wrmsr(MSR_KGSBASE, 0); /* User value while we're in the kernel */ pcb->pcb_fsbase = 0; pcb->pcb_gsbase = 0; - pcb->pcb_kgsbase = rdmsr(MSR_GSBASE); load_ds(_udatasel); load_es(_udatasel); load_fs(_udatasel); ==== //depot/projects/hammer/sys/amd64/include/pcb.h#10 (text+ko) ==== @@ -59,7 +59,6 @@ register_t pcb_rflags; register_t pcb_fsbase; register_t pcb_gsbase; - register_t pcb_kgsbase; u_int32_t pcb_ds; u_int32_t pcb_es; u_int32_t pcb_fs;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305142213.h4EMDd37062540>