Index: x86/x86/x86_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/x86/x86/x86_machdep.c,v retrieving revision 1.30 diff -p -r1.30 x86_machdep.c *** x86/x86/x86_machdep.c 13 Feb 2009 22:41:03 -0000 1.30 --- x86/x86/x86_machdep.c 20 Mar 2009 07:20:34 -0000 *************** cpu_kpreempt_enter(uintptr_t where, int *** 282,287 **** --- 282,289 ---- return true; } + #include + /* * Called after returning from a kernel preemption, and called with * preemption disabled. *************** cpu_kpreempt_exit(uintptr_t where) *** 303,308 **** --- 305,328 ---- pmap_load(); } + { + int curldt; + + __asm__ __volatile__("sldt %0" : "=r" (curldt) : ); + if (curldt != curlwp->l_addr->u_pcb.pcb_ldt_sel) { + const char *mod, *sym; + + if (ksyms_getname(&mod, &sym, where, KSYMS_ANY) != 0) { + mod = ""; + sym = ""; + } + + printf("oink! %x != %x! where = %p (%s:%s)\n", curldt, curlwp->l_addr->u_pcb.pcb_ldt_sel, (void *)where, mod, sym); + //Debugger(); + pmap_load(); + } + } + /* Restore cr2 only after the pmap, as pmap_load can block. */ lcr2(((struct pcb *)curlwp->l_addr)->pcb_cr2); }