From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brzeE-0001w6-W2 for qemu-devel@nongnu.org; Wed, 05 Oct 2016 23:47:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brzeC-0005cx-Sr for qemu-devel@nongnu.org; Wed, 05 Oct 2016 23:47:06 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:45361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brzeC-0005cc-7K for qemu-devel@nongnu.org; Wed, 05 Oct 2016 23:47:04 -0400 Date: Thu, 6 Oct 2016 14:45:43 +1100 From: David Gibson Message-ID: <20161006034543.GE18733@umbus.fritz.box> References: <1475583448-21013-1-git-send-email-clg@kaod.org> <20161004234352.GE18648@umbus.fritz.box> <65e1a873-c9a2-b93e-4680-d1fa5f86316d@kaod.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cYtjc4pxslFTELvY" 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: Peter Maydell Cc: =?iso-8859-1?Q?C=E9dric?= Le Goater , QEMU Developers , Greg Kurz , Laurent Vivier --cYtjc4pxslFTELvY Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 05, 2016 at 07:20:52AM -0700, Peter Maydell wrote: > On 5 October 2016 at 07:00, C=E9dric Le Goater wrote: > > On 10/05/2016 03:53 PM, Peter Maydell wrote: > >> Which tswap? Last time I worked through the stack of > >> what happens I thought that we had the right set of > >> swaps in the right places. > > > > The one I am talking about are under qtest_process_command(), > > see below. >=20 > Those are correct and required, and they do not change > the overall behaviour of the system depending on the host > endianness. (They convert 32-bit values to "bag of > bytes in guest order" which is what the cpu_physical_memory_* > functions want.) These functions are correct for the defined semantics of the readw/readl operations, but those semantics are not useful. This proposal is introducing alternate functions with the more useful semantics which are "convert a 32-bit value to a bag of bytes in LE order" or "convert a 32-bit value to a bag of bytes in BE order" depending on which variant you choose. qtest is about testing hardware, not the guest cpu, and whether you're accessing MMIO space or buffers the hardware will read via DMA, it's the hardware which determines the correct endianness, not the guest cpu. > https://lists.gnu.org/archive/html/qemu-arm/2016-07/msg00037.html > is the explanation from last time around, I think. >=20 > If your test is giving different answers on different > host endiannesses, it is presumably because it is > incorrectly issuing different readl/etc commands > in the two cases. >=20 > thanks > -- PMM >=20 --=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 --cYtjc4pxslFTELvY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX9cjnAAoJEGw4ysog2bOSMdEP/jHgI7epFbrpk92vsALSf2I+ j3s9UIuYdIPhueKVe0ct1zNxUJvGqRV3qUDeZbICQcoJiNFoBi4WV8ps9UUoxijf anRfVfS65A7UHap8YD41obVMmvOGCgNaEofHOqE9gq9gyh7psiDwqA13OyRYxw0x lF4tgf2XJp/GpB2p4mOHqjoqA9nWD5UWVZJRwDbksZaLgvoUzH8irLqIAp7BNnao lVHzTA13g3df7ATy2aqDwMASaYGlESciN25yaL8WWr/dAhONp2HB8tpZuCp1dHlh yoQe2lUAFLOoJEqxlWykq2n2yk/qp23stet3wG86xkUAD4Yx4n5OUL6o8UEojhlX 1bdcellCaUJndu0ebLES6wFfuoEtVcOESX0pMPYZyHx3KgZUboeL62g7JhWuY6lJ iXXnEQs89XKf+uPvC2r3cM6B4PJqacpFjZ9wA+ztoY6xWEWGuzHACSavrJda6Lyo gdlu4iycTujqrb5cgetW1PqLcugNfutdYcntZXOSbm7LrThjVCMx2vfxvCVj++d8 vtL2KN/pvawD30xfdjVVO9YW1ul7MWSpIUXbga1NfMVPCo/FMuBvby6sLLaCubGX qcQfBX0teGv9gevq4xDrzi/qQwRkk9rFoMrcj8DWBt3Jhs36teZuorJvSU/FioNj kW7I6VrKG6AO4PNMGIHw =OjqP -----END PGP SIGNATURE----- --cYtjc4pxslFTELvY--