Date: Mon, 25 Jul 2005 12:06:38 -0700 From: Peter Wemm <peter@wemm.org> To: freebsd-amd64@freebsd.org Cc: Kris Kennaway <kris@obsecurity.org> Subject: Re: fpudna: fpcurthread == curthread 2 times Message-ID: <200507251206.39454.peter@wemm.org> In-Reply-To: <20050411033957.GA21170@xor.obsecurity.org> References: <20050411033957.GA21170@xor.obsecurity.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 10 April 2005 08:39 pm, Kris Kennaway wrote: > Got this on an SMP package machine running 5.4-RC2: > > fpudna: fpcurthread == curthread 1 times > fpudna: fpcurthread == curthread 2 times > > int > fpudna() > { > struct pcb *pcb; > register_t s; > > if (PCPU_GET(fpcurthread) == curthread) { > printf("fpudna: fpcurthread == curthread %d times\n", > ++err_count); > stop_emulating(); > return (1); > } > > Debugging message accidentally left in, or bug? > > Kris If any folks are reliably seeing these messages, please try a tweak to amd64/amd64/fpu.c. The lines near the top that are "__asm()"... please change them all to "__asm __volatile()" This is the code that I'd like changed: #define fldcw(addr) __asm("fldcw %0" : : "m" (*(addr))) #define fnclex() __asm("fnclex") #define fninit() __asm("fninit") #define fnstcw(addr) __asm __volatile("fnstcw %0" : "=m" (*(addr))) #define fnstsw(addr) __asm __volatile("fnstsw %0" : "=m" (*(addr))) #define fxrstor(addr) __asm("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) #define ldmxcsr(r) __asm __volatile("ldmxcsr %0" : : "m" (r)) #define start_emulating() __asm("smsw %%ax; orb %0,%%al; lmsw %%ax" \ : : "n" (CR0_TS) : "ax") #define stop_emulating() __asm("clts") If this tweak has any effect (either better or worse), please let me know. I'm wondering if there are some reordering effects going on here. It is just a wild shot in the dark. It won't hurt anything though and is safe to try. Most likely it is a wild goose chase, but it could be worth a try. What would be worth knowing is: 1) if the patch stops messages for people who see them regularly or repeatably, and/or 2) if the messages keep happening even with the patch applied. The latter case indicates that it is a wild goose chase. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507251206.39454.peter>