From owner-p4-projects@FreeBSD.ORG Fri Jun 18 03:28:39 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AA73816A4D0; Fri, 18 Jun 2004 03:28:39 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8308916A4CE for ; Fri, 18 Jun 2004 03:28:39 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C10143D53 for ; Fri, 18 Jun 2004 03:28:39 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5I3SKu4092591 for ; Fri, 18 Jun 2004 03:28:20 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5I3SK0I092588 for perforce@freebsd.org; Fri, 18 Jun 2004 03:28:20 GMT (envelope-from peter@freebsd.org) Date: Fri, 18 Jun 2004 03:28:20 GMT Message-Id: <200406180328.i5I3SK0I092588@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 55217 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2004 03:28:40 -0000 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);