From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsIn8-0000Fx-Et for qemu-devel@nongnu.org; Thu, 06 Oct 2016 20:13:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsIn3-0003FK-F4 for qemu-devel@nongnu.org; Thu, 06 Oct 2016 20:13:33 -0400 Received: from ozlabs.org ([103.22.144.67]:37755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsIn3-0003DT-2z for qemu-devel@nongnu.org; Thu, 06 Oct 2016 20:13:29 -0400 Date: Fri, 7 Oct 2016 10:31:48 +1100 From: David Gibson Message-ID: <20161006233148.GC18490@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="32u276st3Jlj2kUU" Content-Disposition: inline In-Reply-To: <20161006161142.1d56f98c@bahia> 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: Greg Kurz Cc: Peter Maydell , =?iso-8859-1?Q?C=E9dric?= Le Goater , QEMU Developers , Laurent Vivier --32u276st3Jlj2kUU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 06, 2016 at 04:11:42PM +0200, Greg Kurz wrote: > On Thu, 6 Oct 2016 12:03:34 +0100 > Peter Maydell wrote: >=20 > > On 6 October 2016 at 04:38, David Gibson = wrote: > > > On Wed, Oct 05, 2016 at 05:31:07AM -0700, Peter Maydell wrote: =20 > > >> On 4 October 2016 at 16:43, David Gibson wrote: =20 > > >> > On Tue, Oct 04, 2016 at 01:36:09PM +0100, Peter Maydell wrote: =20 > > >> >> The difficulty with this patch is that it's hard to tell whether > > >> >> it's really required, or if this is just adding an extra layer > > >> >> of byteswapping that should really be done in some other location= =20 > > >> > > > >> > Actually, it's neither. It's not essential for anything, but it > > >> > *removes* an extra layer of byteswapping that really never should = have > > >> > been done in the first place. =20 > > >> > > >> The patch is very clearly adding calls to swapping functions. > > >> It looks like it's mostly convenience functions for not doing > > >> those swaps explicitly in the test cases. =20 > > > > > > It's adding 1 swap on top of the memread/memwrite path - that's the > > > path which had no existing swaps (intended primarily for bag-o'-bytes > > > block access AFAICT). =20 > >=20 > > Yeah, I hadn't noticed it was using the memread/memwrite path. > > I disagree with using that code path for what ought to be > > register read/writes (among other things, it's not clear to me > > that it guarantees that a 4-byte access by the test code is > > always a 4-byte access on the device, etc). > >=20 >=20 > FWIW, Cedric had another proposal which apparently went unnoticed: >=20 > >=20 > 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 That would also be fine by me. --=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 --32u276st3Jlj2kUU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX9t7kAAoJEGw4ysog2bOSVfMQAKG+W6X+wzlyXjOlSoxmY4cB EBKVIqA/cnukZ9MXuxiVTH7BB1r376T02l6anFuscZks4vyJscfz7k7M0IZYVHok pYG1+vmRIvwqV6oH9FVGht7lVhN1HvuzdeNa9/JtlwBuwst8A80WfRxvJo2vO4mJ 6YKFFul3imeH35d7uoH4fjFcvDRqpWCOt+qD/YlyGFaBSMqMFBVZT2NazcrSthK0 4mOMLEkZIz/JEGQ3chGPFhiadnMyfTCk7iM66zuBYX8q4z6Fq4CQmH4+9osSJtlN Nmmftopqgm8H7Wag96b1IrPiQdXau5C+77svhJEaZQPq1JdI7k1QoH2XhCr/6VFw b4/H1HpHcQ06Hp2i8iiLQrrP2elzn2tIC6cPsmBX5sr4ph6d/meTFxoRcnETfer3 gpk4uteLNWv6Zk+Svmes/WeNOi9dUnWNxkgsJIExnkNxun7p7GZhBUmNVJL8tyet Vz/aEL4I9MlsCpfpXCiLzsNRASZxlBAfpXbxFoTvOlP0G5vkC8/bGyL/Lb2LcYJx yI1pNLHChXU5RomgaNPdLAWsqhKQqJrZ0YQqYve6SMBmc5wWb2cr4ipO2cULbIzh HfvfO052i3toqjLVNicP1muMXl6F3OG97599drSv1S2r3aoC5Z5tl5eJ7p50rp+l Pyg/zGtFVX+n3VC2/0k0 =k+QW -----END PGP SIGNATURE----- --32u276st3Jlj2kUU--