From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsIn6-0000Fv-Cu for qemu-devel@nongnu.org; Thu, 06 Oct 2016 20:13:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsIn3-0003GH-U4 for qemu-devel@nongnu.org; Thu, 06 Oct 2016 20:13:31 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:33567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsIn3-0003Da-A3 for qemu-devel@nongnu.org; Thu, 06 Oct 2016 20:13:29 -0400 Date: Fri, 7 Oct 2016 10:34:34 +1100 From: David Gibson Message-ID: <20161006233434.GD18490@umbus.fritz.box> References: <1475583448-21013-1-git-send-email-clg@kaod.org> <20161004234352.GE18648@umbus.fritz.box> <20161006033836.GC18733@umbus.fritz.box> <20161006161142.1d56f98c@bahia> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2Z2K0IlrPCVsbNpk" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Peter Maydell , Paolo Bonzini , Greg Kurz , QEMU Developers , =?iso-8859-1?Q?C=E9dric?= Le Goater --2Z2K0IlrPCVsbNpk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 06, 2016 at 05:59:00PM +0200, Laurent Vivier wrote: >=20 >=20 > On 06/10/2016 17:41, Peter Maydell wrote: > > On 6 October 2016 at 16:36, Paolo Bonzini wrote: > >> > >> > >> On 06/10/2016 16:11, Greg Kurz wrote: > >>> FWIW, Cedric had another proposal which apparently went unnoticed: > >>> > >>> > >>> > >>> The idea is to add an optional endianness argument to the read*/write* > >>> commands in the qtest protocol: > >>> - libqtest then provides explicit _le and _be APIs > >>> - no extra byteswap is performed on the test program side: qtest > >>> actually handles that and does exactly 1 or 0 byteswap. > >>> - it does not use memread/memwrite > >>> - the current 'guest native' API where qtest tswaps is preserved > >>> > >> > >> No, this is a worse idea, because the right place to do the swap is in > >> the "program" (libqtest) not in the "CPU" (QEMU). > >=20 > > Speaking of the right place to do things, perhaps we should > > reimplement qtest_big_endian() in libqtest.c to send a query > > to the QEMU-under-test to ask it what TARGET_BIG_ENDIAN says, > > rather than hardcoding a big list of architectures... >=20 > Yes, it's a good idea. I disagree. TARGET_BIG_ENDIAN is simply not well defined - we should avoid using it at all. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --2Z2K0IlrPCVsbNpk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX9t+KAAoJEGw4ysog2bOShQIQAIBU61DS6zPG5niyFxPhlsH0 lRwCWH4JxsK+14TsKQi1zqEGd0TO61hgx47TGxMHyFKbpCgENJtvUS0+sj+D3rPv EwFIJ87jiBqfaNO6nm5ufxmmq3NaUskw9EIaC0lYKKWHbRd7AI4mEyL8ELNvwIdg w9SD7XH+7zSxo1X7mIMnq6DtWDB6C3bCPrReZlOtRhNuFEdBoPqiovd+/JbgoNO4 RXIuvDbHgsS4+ztSH43W+A/t4cDFapRjyURHv/FravYGjqQrJrQTKQMxUZdoXF/O FAGZWmdJgSq/Wfn+bKiOvsu8vi6rLB7F0bxtTU26tXEANSLDFxpCQsrk45/9bLQn riusO2HC41X1t16ZQDmh3jd5Zct2NbQEBA+NP0HExqr1MYbYn4ffOZ1J/HCiNPOR b3zRYPghBIPaVUENjJ+3KT/j/g9m+DU7l5HOAwcbINLDaLI2ooodNAc8Pwh8tcGO cY5mVd+rG83TkSarrkQapG+WsRBcqlyT1266LZeYMWhCjatMwDVJFOyGKCGcJckd gU9ZfpLcjPgERGAFidbNQ4hxZjhJJ4aU1uDbc31OiicvPaHIv3ZWcFUU3W7vmrNM UMBiaN9uzq3oCKsdsDq0lshMbcusfP/8UAgIlO3QdKfg0jvh/a721OBv0SQSbxY7 /33lt/gKZ0I2Rv7ZyI2i =HNAp -----END PGP SIGNATURE----- --2Z2K0IlrPCVsbNpk--