From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8djF-0007bA-KI for qemu-devel@nongnu.org; Thu, 02 Jun 2016 21:16:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8djD-0006fk-Au for qemu-devel@nongnu.org; Thu, 02 Jun 2016 21:16:48 -0400 Date: Fri, 3 Jun 2016 11:16:04 +1000 From: David Gibson Message-ID: <20160603011604.GE1087@voom.fritz.box> References: <146468219419.25446.8053365248306938869.stgit@bahia.huguette.org> <81bca811-db78-ffd2-dbfc-67e14ae88ce2@redhat.com> <20160531151029.605aebb1@bahia.lab.toulouse-stg.fr.ibm.com> <0818d93b-358a-647d-b14b-698ae74031a1@redhat.com> <20160601023328.GB15455@voom.fritz.box> <20160602180437.02f3ed85@bahia.huguette.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bi5JUZtvcfApsciF" Content-Disposition: inline In-Reply-To: <20160602180437.02f3ed85@bahia.huguette.org> Subject: Re: [Qemu-devel] [PATCH] virtio: move bi-endian target support to a single location List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: Paolo Bonzini , Peter Maydell , "Michael S. Tsirkin" , Alexander Graf , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org --bi5JUZtvcfApsciF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 02, 2016 at 06:04:37PM +0200, Greg Kurz wrote: > On Wed, 1 Jun 2016 12:33:28 +1000 > David Gibson wrote: >=20 > > On Tue, May 31, 2016 at 03:15:21PM +0200, Paolo Bonzini wrote: > > >=20 > > >=20 > > > On 31/05/2016 15:10, Greg Kurz wrote: =20 > > > >>> > > +#if defined(TARGET_PPC64) || defined(TARGET_ARM) > > > >>> > > +#define LEGACY_VIRTIO_IS_BIENDIAN 1 > > > >>> > > +#endif =20 > > > >> >=20 > > > >> > These will only be correct if something else includes cpu.h. In= stead of =20 > > > > Unless I missed something, the TARGET_* macros come from the genera= ted > > > > config-target.h header, which is in turn included by qemu/osdep.h a= nd > > > > thus included by most of the code. =20 > > >=20 > > > You're right. Problems _could_ happen if virtio-access.h is included= in > > > a file compiled without -DNEED_CPU_H (i.e. with common-obj-y instead = of > > > obj-y) but include/exec/poison.h should take care of that. > > > =20 > > > >> > defining this, you should add > > > >> >=20 > > > >> > #include "cpu.h" > > > >> >=20 > > > >> > at the top of include/hw/virtio-access.h and leave the definitio= ns in > > > >> > target-*/cpu.h. > > > >> > =20 > > > > All this bi-endian stuff is really an old-virtio-only thing... it is > > > > only to be used by virtio_access_is_big_endian(). The fact that it > > > > broke silently with your cleanup series is yet another proof that > > > > this workaround is fragile. =20 > > >=20 > > > It is not fragile actually. cpu.h doesn't exist in common-obj-y, so = the > > > TARGET_IS_BIENDIAN define can be safely taken from cpu.h. > > >=20 > > > Anyway because of poison.h your solution isn't fragile either, so > > >=20 > > > Reviewed-by: Paolo Bonzini =20 > >=20 > > Should I take this through my tree? > >=20 >=20 > That would be great ! Actually, that was a question for Paolo.. --=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 --bi5JUZtvcfApsciF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXUNpUAAoJEGw4ysog2bOSpOAP/1cUsuLU/EMthfrCZT/Cs18K zjj4trllX4QYEE6PlUwvmm2G8fKdz35DfbfqlP0UnR9L2+DHNCwc3pmgsa8e2oIx w2bj6EG7cZD9nCqet2SS1DBF3t9VuWzObkelX0Sl0zH6eH4tfTk3Rn3ClVd8jc0b uqcpv6RumTa/NtYgMF7la6AjhVxFdwSJCDYGI06e3+8EeegkqUiUwMmGDe+Wg+Gm P1yNvcLNrF87qBw65Sqc/oK67fzN9ILi57BEgVfYWi5opjlqdXimAIganW0iPctu bKOMoGvv+CpBiHZdd5xG86/mxYTFiCZgzUY7asWvGo3lpdQXqegMdsx6OShRb7/c Zomue2+rqDtSzWMiyaD+6Sr80ta4lUjW0mB7e74edSR2pgpDnAy8t3pGX65kFrTw h8i/JWOt0US/my9Za940AEHpFYkBixqtpINFbIlb/Q/O43BkuFV0VHHaKoD0Y4IO orbxrkl8rk8RwSAh1Sk1qktuuZEeS0zaol78NMpdX/qCniCyAoT32yyYzuhfnu7U 9FJ/+gVB5c/jtIj3Zr1puyHqEQMti6SdsXzc9SjWS90aroIN4OuhkqAyCge8EbkC 0BM1qjf7Jk0DJbcCSyHkXPPuvHM9+jb0mT9abD1uxygVv+qFPXoZLYk9Vyb19MZ+ 3Ry0s//VK5p5VHwuaBiS =H2rG -----END PGP SIGNATURE----- --bi5JUZtvcfApsciF--