Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/i386/i386/locore.S,v retrieving revision 1.53 retrieving revision 1.54 diff -u -p -r1.53 -r1.54 --- src/sys/arch/i386/i386/locore.S 2007/10/18 15:28:35 1.53 +++ src/sys/arch/i386/i386/locore.S 2007/11/10 20:06:24 1.54 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.53 2007/10/18 15:28:35 yamt Exp $ */ +/* $NetBSD: locore.S,v 1.54 2007/11/10 20:06:24 ad Exp $ */ /* * Copyright-o-rama! @@ -755,9 +755,9 @@ ENTRY(cpu_switchto) /* Switch TSS. Reset "task busy" flag before loading. */ movl %cr3,%eax movl %eax,PCB_CR3(%ebx) # for TSS gates - movl CPUVAR(GDT),%eax + movl CPUVAR(GDT),%ecx movl L_MD_TSS_SEL(%edi),%edx - andl $~0x0200,4(%eax,%edx, 1) + andl $~0x0200,4(%ecx,%edx, 1) ltr %dx /* Set curlwp. */ @@ -772,6 +772,16 @@ ENTRY(cpu_switchto) cmpl $0,P_RASLIST(%eax) jne 5f + /* Restore thread-private %fs/%gs descriptors. */ + movl L_MD_FSD(%edi), %eax + movl L_MD_FSD+4(%edi), %edx + movl %eax, (GUFS_SEL*8)(%ecx) + movl %edx, (GUFS_SEL*8+4)(%ecx) + movl L_MD_GSD(%edi), %eax + movl L_MD_GSD+4(%edi), %edx + movl %eax, (GUGS_SEL*8)(%ecx) + movl %edx, (GUGS_SEL*8+4)(%ecx) + /* * Restore cr0 (including FPU state). Raise the IPL to IPL_IPI. * FPU IPIs can alter the LWP's saved cr0. Dropping the priority