Date: Fri, 18 Jun 2004 03:28:20 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 55217 for review Message-ID: <200406180328.i5I3SK0I092588@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=55217 Change 55217 by peter@peter_overcee on 2004/06/18 03:27:41 attempt to fix fpu initial state based on tjr's observations. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/fpu.c#18 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/fpu.c#18 (text+ko) ==== @@ -125,6 +125,8 @@ ldmxcsr(mxcsr); fxsave(&fpu_cleanstate); start_emulating(); + bzero(fpu_cleanstate.sv_fp, sizeof(fpu_cleanstate.sv_fp)); + bzero(fpu_cleanstate.sv_xmm, sizeof(fpu_cleanstate.sv_xmm)); fpu_cleanstate_ready = 1; intr_restore(savecrit); } @@ -384,7 +386,6 @@ { struct pcb *pcb; register_t s; - u_short control; if (PCPU_GET(fpcurthread) == curthread) { printf("fpudna: fpcurthread == curthread %d times\n", @@ -409,13 +410,10 @@ if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { /* - * This is the first time this thread has used the FPU or - * the PCB doesn't contain a clean FPU state. Explicitly - * initialize the FPU and load the default control word. + * This is the first time this thread has used the FPU, + * explicitly load sanitized registers. */ - fninit(); - control = __INITIAL_FPUCW__; - fldcw(&control); + fxrstor(&fpu_cleanstate); pcb->pcb_flags |= PCB_FPUINITDONE; } else fxrstor(&pcb->pcb_save);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406180328.i5I3SK0I092588>