Date: Mon, 28 May 2012 16:36:33 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Bruce Evans <brde@optusnet.com.au> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Ed Schouten <ed@freebsd.org>, rwatson@freebsd.org, svn-src-head@freebsd.org, jonathan@freebsd.org Subject: Re: svn commit: r236026 - in head/sys: amd64/linux32 compat/freebsd32 kern Message-ID: <20120528133633.GB2358@deviant.kiev.zoral.com.ua> In-Reply-To: <20120527043827.W3357@besplex.bde.org> References: <201205252150.q4PLomFk035064@svn.freebsd.org> <20120526173233.A885@besplex.bde.org> <20120526164927.GU2358@deviant.kiev.zoral.com.ua> <20120527043827.W3357@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--tYqdTR6Mwu/xEI6p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 27, 2012 at 07:49:36AM +1000, Bruce Evans wrote: > On Sat, 26 May 2012, Konstantin Belousov wrote: >=20 > >On Sat, May 26, 2012 at 10:21:25PM +1000, Bruce Evans wrote: > >The 'low level' AKA magic happens in several *_fetch_syscall_args() > >functions. For both linux32 and freebsd32, the magic code automatically > >zero-extends the arguments into 64bit entities. Linux passes args in > >registers, while FreeBSD uses words on stack. >=20 > Actually, the amd64 linux_fetch32_fetch_syscall_args() just copies from > 64-bit registers frame->tf_r* to 64-bit sa->args[*]. I can't see how > this gives anything except garbage in the top bits. Is there magic in > the switch to 64-bit mode that sets the top bits? Anyway, sign extension > would give garbage for unsigned args, and zero-extension would give > garbage for negative signed args. Hardware zero-extends any register touched in the 32bit mode. In fact, please see r217991 for related bug. --tYqdTR6Mwu/xEI6p Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/Df2EACgkQC3+MBN1Mb4ip6wCgggnSTu1Pu2ez7ezggGkwCKAC r+4An1hr9XYzUqXU6Mg19LKkFUWuareL =UlcY -----END PGP SIGNATURE----- --tYqdTR6Mwu/xEI6p--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120528133633.GB2358>