From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btTcD-00074g-D7 for qemu-devel@nongnu.org; Mon, 10 Oct 2016 01:59:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btTc9-0004Rj-79 for qemu-devel@nongnu.org; Mon, 10 Oct 2016 01:59:08 -0400 Received: from ozlabs.org ([103.22.144.67]:48067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btTc8-0004QE-BZ for qemu-devel@nongnu.org; Mon, 10 Oct 2016 01:59:05 -0400 Date: Mon, 10 Oct 2016 15:55:52 +1100 From: David Gibson Message-ID: <20161010045552.GC22498@umbus.fritz.box> References: <1475835267-7300-1-git-send-email-lvivier@redhat.com> <20161007124849.7c867d79@bahia> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lMM8JwqTlfDpEaS6" Content-Disposition: inline In-Reply-To: <20161007124849.7c867d79@bahia> Subject: Re: [Qemu-devel] [PATCH v2] qtest: ask endianness of the target in qtest_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: Laurent Vivier , qemu-devel@nongnu.org, Peter Maydell --lMM8JwqTlfDpEaS6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 07, 2016 at 12:48:49PM +0200, Greg Kurz wrote: > On Fri, 7 Oct 2016 12:14:27 +0200 > Laurent Vivier wrote: >=20 > > The target endianness is not deduced anymore from > > the architecture name but asked directly to the guest, > > using a new qtest command: "endianness". As it can't > > change (this is the value of TARGET_WORDS_BIGENDIAN), > > we store it to not have to ask every time we want to > > know if we have to byte-swap a value. > >=20 > > Signed-off-by: Laurent Vivier > > CC: Greg Kurz > > CC: David Gibson > > CC: Peter Maydell > > --- > > v2: > > - move the "endianness" command to a function and > > don't move the qtest_init()/qtest_quit() functions > >=20 >=20 > Not speaking about the current discussion on TARGET_WORDS_BIGENDIAN, > I guess a consensus could be that this only makes sense when testing > legacy virtio. People should not be tempted to use this anywhere else > actually. I agree in principle. However right now - until we get fixed-endianness qtest accessors of some sort - this test is more or less necessary to make most tests cross platform correct (except PCI, see below). That's because the testcase will generally know the endianness of the hardware it's testing, but has to compensate for the endianness that the readw/writew primitives will use along the way. For PCI we side steo this, because the PCI read/write wrappers are already target specific, and include unconditional swaps to compoensate for the "guest endianness". --=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 --lMM8JwqTlfDpEaS6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX+x9YAAoJEGw4ysog2bOS6XYQAKwmZpaDEVcoLhqV9d7ahs4d 6s9CL1U+F4K9jYLcA85tFkg5r03RsLWXQ0dtExIn/zdUww8K0YwpOpi0X+AjaWuQ YpVqzcqH+lp+X2q3/zwbvl+qCmN3EV1Jof1kzRDNSe39G5mr3BeF9d+TL2zn5C5C 6DKMBo5o+32HrE2OfQ8i6pbZl3u7gioUrvAI7ZWAgJF36miPJrSOQTNAmpJWMoBP krba9/6IAPXh0Dng0HnE94eJocNCEPZj+QOgbqgwxgrW/6QPX+dAswV4hP1VuLvK JTrS1PSxm0fUU8F6XXqn9YTq13ecLYHeq/H42tHxBc0rLNcS0xpTnCE2x1ecNY4/ nX4fF+X9qILghGGzKOfWtu+UOxyTh3DGnRv0zZZZXUGIG73HubNTYHkeN4RlQ4D8 LAiKxYe8EuJqW6IoS6zGinpwZGcqtf3Ph7NihMnreLjERWNFtCNx6bHoS0inw00L ly+8JkWkZYzNw+AdNWPsyTJd7m80INdygs+3c3ZbiOTdtq6vA4XJrCFb/0XiHlFR C7mK9yf99FBneSy6awOy2ay5NfvkAxDPqZ8+DdZo81JZTzJf2IRtnayAB0xpFDGH zQzkgfZyryDE8/I5fmNOyoBZuJGW6mTLexT0PlXs4ZOgjUBf+PbTHW2PKabTF6vs lWgnvIIklC8BiOF22i/j =tudK -----END PGP SIGNATURE----- --lMM8JwqTlfDpEaS6--