Index: i386/i386/genassym.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/genassym.c,v retrieving revision 1.151 diff -u -r1.151 genassym.c --- i386/i386/genassym.c 13 Apr 2005 22:57:17 -0000 1.151 +++ i386/i386/genassym.c 23 Dec 2005 04:21:42 -0000 @@ -198,6 +198,7 @@ ASSYM(PC_CURRENTLDT, offsetof(struct pcpu, pc_currentldt)); ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid)); ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap)); +ASSYM(PC_PRIVATE_TSS, offsetof(struct pcpu, pc_private_tss)); #ifdef DEV_APIC ASSYM(LA_VER, offsetof(struct LAPIC, version)); Index: i386/i386/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.620 diff -u -r1.620 machdep.c --- i386/i386/machdep.c 24 Nov 2005 08:16:18 -0000 1.620 +++ i386/i386/machdep.c 23 Dec 2005 04:21:43 -0000 @@ -1285,8 +1285,6 @@ union descriptor ldt[NLDT]; /* local descriptor table */ struct region_descriptor r_gdt, r_idt; /* table descriptors */ -int private_tss; /* flag indicating private tss */ - #if defined(I586_CPU) && !defined(NO_F00F_HACK) extern int has_f00f_bug; #endif @@ -2241,7 +2239,6 @@ KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb) - 16); PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); - private_tss = 0; PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd); PCPU_SET(common_tssd, *PCPU_GET(tss_gdt)); PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16); Index: i386/i386/swtch.s =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/swtch.s,v retrieving revision 1.149 diff -u -r1.149 swtch.s --- i386/i386/swtch.s 16 Aug 2005 18:15:17 -0000 1.149 +++ i386/i386/swtch.s 23 Dec 2005 04:21:43 -0000 @@ -197,7 +197,7 @@ */ cmpl $0, PCB_EXT(%edx) /* has pcb extension? */ je 1f /* If not, use the default */ - btsl %esi, private_tss /* mark use of private tss */ + movl $1, PCPU(PRIVATE_TSS) /* mark use of private tss */ movl PCB_EXT(%edx), %edi /* new tss descriptor */ jmp 2f /* Load it up */ @@ -213,8 +213,9 @@ * Test this CPU's bit in the bitmap to see if this * CPU was using a private TSS. */ - btrl %esi, private_tss /* Already using the common? */ - jae 3f /* if so, skip reloading */ + cmpl $0, PCPU(PRIVATE_TSS) /* Already using the common? */ + je 3f /* if so, skip reloading */ + movl $0, PCPU(PRIVATE_TSS) PCPU_ADDR(COMMON_TSSD, %edi) 2: /* Move correct tss descriptor into GDT slot, then reload tr. */ Index: i386/i386/sys_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/sys_machdep.c,v retrieving revision 1.103 diff -u -r1.103 sys_machdep.c --- i386/i386/sys_machdep.c 15 Sep 2005 17:30:07 -0000 1.103 +++ i386/i386/sys_machdep.c 23 Dec 2005 04:21:43 -0000 @@ -267,12 +267,12 @@ KASSERT(td->td_pcb->pcb_ext == 0, ("already have a TSS!")); /* Switch to the new TSS. */ - mtx_lock_spin(&sched_lock); + critical_enter(); td->td_pcb->pcb_ext = ext; - private_tss |= PCPU_GET(cpumask); + PCPU_SET(private_tss, 1); *PCPU_GET(tss_gdt) = ext->ext_tssd; ltr(GSEL(GPROC0_SEL, SEL_KPL)); - mtx_unlock_spin(&sched_lock); + critical_exit(); return 0; } Index: i386/include/pcpu.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/pcpu.h,v retrieving revision 1.44 diff -u -r1.44 pcpu.h --- i386/include/pcpu.h 13 Apr 2005 22:57:17 -0000 1.44 +++ i386/include/pcpu.h 23 Dec 2005 04:21:43 -0000 @@ -54,7 +54,8 @@ struct segment_descriptor *pc_fsgs_gdt; \ int pc_currentldt; \ u_int pc_acpi_id; \ - u_int pc_apic_id + u_int pc_apic_id; \ + int pc_private_tss /* flag indicating private tss */ #if defined(lint)