From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7vym-0000JP-GE for qemu-devel@nongnu.org; Tue, 31 May 2016 22:33:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7vyk-0002Cb-8H for qemu-devel@nongnu.org; Tue, 31 May 2016 22:33:55 -0400 Date: Wed, 1 Jun 2016 12:33:28 +1000 From: David Gibson Message-ID: <20160601023328.GB15455@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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oC1+HKm2/end4ao3" Content-Disposition: inline In-Reply-To: <0818d93b-358a-647d-b14b-698ae74031a1@redhat.com> 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: Paolo Bonzini Cc: Greg Kurz , Peter Maydell , "Michael S. Tsirkin" , Alexander Graf , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org --oC1+HKm2/end4ao3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 31, 2016 at 03:15:21PM +0200, Paolo Bonzini wrote: >=20 >=20 > On 31/05/2016 15:10, Greg Kurz wrote: > >>> > > +#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. Instea= d of > > Unless I missed something, the TARGET_* macros come from the generated > > config-target.h header, which is in turn included by qemu/osdep.h and > > thus included by most of the code. >=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 definitions 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 > 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 Should I take this through my tree? --=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 --oC1+HKm2/end4ao3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXTkl4AAoJEGw4ysog2bOSFdoQAMFWbCYvKmzyydaEf1zsIVmV TELvgB3pkduKVUHiN9rB6ioFI6Q7o21nRtJEuzqBWRSgERYIBIf/DO6izYYyGTSg JWZ335N3pA2q6iKlYLlRKV8WozCOgCJC2B+OCBoqsryqsVBJPE2KoAMOGo9tnx0Y mMy10r4l80IOsyPpGo18/Ruxwu0RarF943cl9wV2nxOkjvUIS3VZh98LmYj3k8Av D3PHUVypW9VINBdFSCpK3FpDo3+AGrgWxkR1bpxGWhktClGVwB+QkOql7ewoN1RX 4R2DsSjtepGUfVQyob7st9wcu0NYlGkRn9NtWwti7mM4EP1FVlHkHJ/J7TnUcnNE XU9tzZewpuJN0Q5pFfpNqOlIIcwPYHHjrvqdo3zz88HEZ+vTsNHFCZsOpElbZ77g y2/1StydScrMw8Wkc9IytDUXDk1GdFZDUBn+C1y//fdVtAl0heXK5ZWOVcKr3TdP CwjARmDY+hG+dk221a89F/vyO8ye/abx3lnAWBzbEGSK4LV2ZlimkBBRFWPqISD8 pKJV1lsGTxpHHphodoqEYzGkQOWlBGnzWHgP9pDeS1PZ6EDxj/UxyenB5GHAeNrl Ipcy73nkYFQOc96mwAHJ1Kx2RkAOo7ZxeB7YYWqrF1CnjN2ZlPjrGKcpKnTzk5lM 7rpb4RK024Z1r3v3ChSn =uQ/N -----END PGP SIGNATURE----- --oC1+HKm2/end4ao3--