Module Name: src Committed By: jmcneill Date: Tue Dec 20 13:17:05 UTC 2011
Modified Files: src/sys/arch/amd64/amd64: process_machdep.c Log Message: from http://www.freshbsd.org/commit/openbsd/ae7f934ae5bdf57dcf3431ba55fd1da93b8f1963 Initialize abridged tag word properly. x87 spec says FNINIT says tag word contains FFFFh (all stack locations empty) which would make abridged tag word 00h. From the Intel 64 and IA-32 Architectures Software Developer's Manual: "The FXSAVE instruction saves an abridged version of the x87 FPU tag word in the FTW field (unlike the FSAVE instruction, which saves the complete tag word). The tag information is saved in physical register order (R0 through R7), rather than in top-of- stack (TOS) order. With the FXSAVE instruction, however, only a single bit (1 for valid or 0 for empty) is saved for each tag." ok rmind@ To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/amd64/amd64/process_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/amd64/process_machdep.c diff -u src/sys/arch/amd64/amd64/process_machdep.c:1.18 src/sys/arch/amd64/amd64/process_machdep.c:1.19 --- src/sys/arch/amd64/amd64/process_machdep.c:1.18 Mon Dec 20 00:25:24 2010 +++ src/sys/arch/amd64/amd64/process_machdep.c Tue Dec 20 13:17:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.18 2010/12/20 00:25:24 matt Exp $ */ +/* $NetBSD: process_machdep.c,v 1.19 2011/12/20 13:17:05 jmcneill Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -53,7 +53,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.18 2010/12/20 00:25:24 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.19 2011/12/20 13:17:05 jmcneill Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -124,7 +124,7 @@ process_read_fpregs(struct lwp *l, struc memset(frame, 0, sizeof(*regs)); frame->fx_fcw = cw; frame->fx_fsw = 0x0000; - frame->fx_ftw = 0xff; + frame->fx_ftw = 0x00; /* abridged tag; all empty */ frame->fx_mxcsr = mxcsr; frame->fx_mxcsr_mask = mxcsr_mask; l->l_md.md_flags |= MDP_USEDFPU;