From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDiyw-0000qA-MA for qemu-devel@nongnu.org; Tue, 20 Jan 2015 19:17:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDiys-0004NC-K1 for qemu-devel@nongnu.org; Tue, 20 Jan 2015 19:17:14 -0500 Received: from ozlabs.org ([103.22.144.67]:44759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDiys-0004N4-9L for qemu-devel@nongnu.org; Tue, 20 Jan 2015 19:17:10 -0500 Date: Wed, 21 Jan 2015 11:17:26 +1100 From: David Gibson Message-ID: <20150121001726.GB27371@voom.fritz.box> References: <1421687077-9025-1-git-send-email-stefanha@redhat.com> <1421687077-9025-3-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1LKvkjL3sHcu1TtY" Content-Disposition: inline In-Reply-To: <1421687077-9025-3-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] dataplane: use virtio_ld/st_p() for endian-aware memory access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Paolo Bonzini , Fam Zheng , qemu-devel@nongnu.org --1LKvkjL3sHcu1TtY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 19, 2015 at 05:04:37PM +0000, Stefan Hajnoczi wrote: > The vring.c code was written under the assumption that virtio devices > have the same endianness as the host. >=20 > This is wrong when emulating targets that differ in endianness from the > host. >=20 > It is also wrong when emulating bi-endian targets like POWER 8 > processors, which support both little- and big-endian at run-time. In > this case the virtio device knows which endianness to use. >=20 > This change requires the virtio-access.h APIs and therefore builds > vring.o for each target (obj-y instead of common-obj-y). >=20 > Note that $(CONFIG_VIRTIO) for dataplane/ was dropped in > hw/virtio/Makefile.objs because hw/Makefile.objs conditionally includes > hw/virtio/ on $(CONFIG_VIRTIO) already. >=20 > Only a small change is needed to the vring.h interface: vring_push() now > takes a VirtIODevice *vdev argument. >=20 > Cc: Paolo Bonzini > Cc: Fam Zheng > Signed-off-by: Stefan Hajnoczi Without this patch adding an iothread to a secondary virtio-blk disk caused the kernel to jam up during boot. With this patch it booted up and I was able to do things with the disk. I'm still not able to add an iothread to a primary virtio-blk device: SLOF (guest firmware) gets errors attempting to read the kernel to boot. However, SLOF is always big endian, so I think that's an unrelated bug. Reviewed-by: David Gibson Tested-by: David Gibson --=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 --1LKvkjL3sHcu1TtY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUvvAWAAoJEGw4ysog2bOS3XkQAOe3gweLrVeQUPJHWlZlBKEh F+0QbklXIqN4PwJ9JQt1WvV8MPy1zA/ReJaSt24YGTBMaCbzwtvPdqZqvqCe/myX StMXynAAm34G8T+Z8/RxFyeeA67e8xdFhcG4Olv4pVIzTkU5os7UD5hjWtmBb1CD 4O9fbVTP94WyKQlaTJuonUVUJUY2MYph1ZlfVd60spE+Dkzi8JaLCZp4CwsdRCBP T2IRzGM2K2XlcNxKGX6TLOKB1QKh0TAnAKLrSLpZ5bbVVVtFHiCx1Murqb06ACVb Kct6yF+n7QxySxTwFPvR3aR0gEVrAZjkwnG8F6Q+5do5bws7BYkqpMEqw5I+oJab sGEUJC7N8fbtmX7d0kEjmcQNFlHT24cx8m9eoxFEj3qby9VGydnTQz4xUJPX59EN lJCk8OFJzwaJVfqbk0jODW+Y5QE9vATVbcsp0XdtcG7S7/LDfAb5WYYFQTuPkSsN pQwETOeygcQLMZrtey2FBPCfwLyFQdjNy/yHNx1X6rOEILKVwZWGui/3by0CjNJj nFiEK+9QdMQnXEcxBD/CDAYBiOl5xaLoIUVQNWK7GK6UjAOKp1tlCoKuVmmQpk9w 8u7A3RD1HiU+R1WdQQATKfUXffJCbXqrFzBdpJsrWkUR9N0+AaHvKhFuOqZqb9dB E559HqRchow2yXo81Yt8 =9S9y -----END PGP SIGNATURE----- --1LKvkjL3sHcu1TtY--