From owner-svn-src-head@FreeBSD.ORG Sat May 29 03:06:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E64DA1065670; Sat, 29 May 2010 03:06:56 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D52368FC1B; Sat, 29 May 2010 03:06:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4T36uff087143; Sat, 29 May 2010 03:06:56 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4T36uog087141; Sat, 29 May 2010 03:06:56 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201005290306.o4T36uog087141@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sat, 29 May 2010 03:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208632 - head/sys/pc98/pc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2010 03:06:57 -0000 Author: nyan Date: Sat May 29 03:06:56 2010 New Revision: 208632 URL: http://svn.freebsd.org/changeset/base/208632 Log: MFi386: revision 208604 Clarify a potential issue in get_fpcontext() use. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat May 29 02:14:05 2010 (r208631) +++ head/sys/pc98/pc98/machdep.c Sat May 29 03:06:56 2010 (r208632) @@ -563,6 +563,13 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sf.sf_uc.uc_mcontext.mc_gs = rgs(); bcopy(regs, &sf.sf_uc.uc_mcontext.mc_fs, sizeof(*regs)); sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ + + /* + * The get_fpcontext() call must be placed before assignments + * to mc_fsbase and mc_gsbase due to the alignment-override + * code in get_fpcontext() that possibly clobbers 12 bytes of + * mcontext after mc_fpstate. + */ get_fpcontext(td, &sf.sf_uc.uc_mcontext); fpstate_drop(td); /* @@ -2455,6 +2462,13 @@ get_mcontext(struct thread *td, mcontext mcp->mc_esp = tp->tf_esp; mcp->mc_ss = tp->tf_ss; mcp->mc_len = sizeof(*mcp); + + /* + * The get_fpcontext() call must be placed before assignments + * to mc_fsbase and mc_gsbase due to the alignment-override + * code in get_fpcontext() that possibly clobbers 12 bytes of + * mcontext after mc_fpstate. + */ get_fpcontext(td, mcp); sdp = &td->td_pcb->pcb_gsd; mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase;