From owner-svn-src-stable@FreeBSD.ORG Fri Aug 31 12:04:30 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19A321065670; Fri, 31 Aug 2012 12:04:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 030D58FC14; Fri, 31 Aug 2012 12:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7VC4TGI027210; Fri, 31 Aug 2012 12:04:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7VC4TQM027208; Fri, 31 Aug 2012 12:04:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208311204.q7VC4TQM027208@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 Aug 2012 12:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239947 - stable/9/sys/amd64/amd64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2012 12:04:30 -0000 Author: kib Date: Fri Aug 31 12:04:29 2012 New Revision: 239947 URL: http://svn.freebsd.org/changeset/base/239947 Log: MFC r238669: Force clean FPU state in PCB user FPU save area by performing getfpuregs(9) before accessing user FPU save area in ptrace_machdep.c for PT_I386_{GET,SET}XMMREGS and PT_{GET,SET}XSTATE. Modified: stable/9/sys/amd64/amd64/ptrace_machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/ptrace_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/ptrace_machdep.c Fri Aug 31 12:01:35 2012 (r239946) +++ stable/9/sys/amd64/amd64/ptrace_machdep.c Fri Aug 31 12:04:29 2012 (r239947) @@ -50,6 +50,7 @@ cpu_ptrace_xstate(struct thread *td, int switch (req) { case PT_GETXSTATE: + fpugetregs(td); savefpu = (char *)(get_pcb_user_save_td(td) + 1); error = copyout(savefpu, addr, cpu_max_ext_state_size - sizeof(struct savefpu)); @@ -62,8 +63,10 @@ cpu_ptrace_xstate(struct thread *td, int } savefpu = malloc(data, M_TEMP, M_WAITOK); error = copyin(addr, savefpu, data); - if (error == 0) + if (error == 0) { + fpugetregs(td); error = fpusetxstate(td, savefpu, data); + } free(savefpu, M_TEMP); break; @@ -89,11 +92,13 @@ cpu32_ptrace(struct thread *td, int req, switch (req) { case PT_I386_GETXMMREGS: + fpugetregs(td); error = copyout(get_pcb_user_save_td(td), addr, sizeof(*fpstate)); break; case PT_I386_SETXMMREGS: + fpugetregs(td); fpstate = get_pcb_user_save_td(td); error = copyin(addr, fpstate, sizeof(*fpstate)); fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask;