[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] dataplane: use virtio_ld/st_p() for endian-
From: |
David Gibson |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] dataplane: use virtio_ld/st_p() for endian-aware memory access |
Date: |
Wed, 21 Jan 2015 11:17:26 +1100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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.
>
> This is wrong when emulating targets that differ in endianness from the
> host.
>
> 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.
>
> This change requires the virtio-access.h APIs and therefore builds
> vring.o for each target (obj-y instead of common-obj-y).
>
> 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.
>
> Only a small change is needed to the vring.h interface: vring_push() now
> takes a VirtIODevice *vdev argument.
>
> Cc: Paolo Bonzini <address@hidden>
> Cc: Fam Zheng <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
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 <address@hidden>
Tested-by: David Gibson <address@hidden>
--
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
pgpdWSwDRVmLH.pgp
Description: PGP signature