[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC 05/11] virtio: introduce legacy virtio devic
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH RFC 05/11] virtio: introduce legacy virtio devices |
Date: |
Thu, 30 Oct 2014 19:02:01 +0100 |
On Tue, 28 Oct 2014 16:40:18 +0100
Greg Kurz <address@hidden> wrote:
> On Tue, 7 Oct 2014 16:40:01 +0200
> Cornelia Huck <address@hidden> wrote:
>
> > Introduce a helper function to indicate whether a virtio device is
> > operating in legacy or virtio standard mode.
> >
> > It may be used to make decisions about the endianess of virtio accesses
> > and other virtio-1 specific changes, enabling us to support transitional
> > devices.
> >
> > Reviewed-by: Thomas Huth <address@hidden>
> > Signed-off-by: Cornelia Huck <address@hidden>
> > ---
> > hw/virtio/virtio.c | 6 +++++-
> > include/hw/virtio/virtio-access.h | 4 ++++
> > include/hw/virtio/virtio.h | 13 +++++++++++--
> > 3 files changed, 20 insertions(+), 3 deletions(-)
> >
> > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> > index 7aaa953..e6ae3a0 100644
> > --- a/hw/virtio/virtio.c
> > +++ b/hw/virtio/virtio.c
> > @@ -883,7 +883,11 @@ static bool virtio_device_endian_needed(void *opaque)
> > VirtIODevice *vdev = opaque;
> >
> > assert(vdev->device_endian != VIRTIO_DEVICE_ENDIAN_UNKNOWN);
> > - return vdev->device_endian != virtio_default_endian();
> > + if (virtio_device_is_legacy(vdev)) {
> > + return vdev->device_endian != virtio_default_endian();
> > + }
> > + /* Devices conforming to VIRTIO 1.0 or later are always LE. */
> > + return vdev->device_endian != VIRTIO_DEVICE_ENDIAN_LITTLE;
> > }
> >
>
> Shouldn't we have some code doing the following somewhere ?
>
> if (!virtio_device_is_legacy(vdev)) {
> vdev->device_endian = VIRTIO_DEVICE_ENDIAN_LITTLE;
> }
>
> also, since virtio-1 is LE only, do we expect device_endian to
> be different from VIRTIO_DEVICE_ENDIAN_LITTLE ?
device_endian should not depend on whether the device is legacy or not.
virtio_is_big_endian always returns false for virtio-1 devices, though.
- [Qemu-devel] [PATCH RFC 00/11] qemu: towards virtio-1 host support, Cornelia Huck, 2014/10/07
- [Qemu-devel] [PATCH RFC 09/11] s390x/virtio-ccw: add virtio set-revision call, Cornelia Huck, 2014/10/07
- [Qemu-devel] [PATCH RFC 03/11] virtio: support more feature bits, Cornelia Huck, 2014/10/07
- [Qemu-devel] [PATCH RFC 11/11] s390x/virtio-ccw: enable virtio 1.0, Cornelia Huck, 2014/10/07
- [Qemu-devel] [PATCH RFC 08/11] s390x/css: Add a callback for when subchannel gets disabled, Cornelia Huck, 2014/10/07
- [Qemu-devel] [PATCH RFC 02/11] virtio: cull virtio_bus_set_vdev_features, Cornelia Huck, 2014/10/07
- [Qemu-devel] [PATCH RFC 05/11] virtio: introduce legacy virtio devices, Cornelia Huck, 2014/10/07
- [Qemu-devel] [PATCH RFC 06/11] virtio: allow virtio-1 queue layout, Cornelia Huck, 2014/10/07
- [Qemu-devel] [PATCH RFC 10/11] s390x/virtio-ccw: support virtio-1 set_vq format, Cornelia Huck, 2014/10/07
- [Qemu-devel] [PATCH RFC 04/11] s390x/virtio-ccw: fix check for WRITE_FEAT, Cornelia Huck, 2014/10/07
- [Qemu-devel] [PATCH RFC 01/11] linux-headers/virtio_config: Update with VIRTIO_F_VERSION_1, Cornelia Huck, 2014/10/07
- [Qemu-devel] [PATCH RFC 07/11] dataplane: allow virtio-1 devices, Cornelia Huck, 2014/10/07
- Re: [Qemu-devel] [PATCH RFC 00/11] qemu: towards virtio-1 host support, Andy Lutomirski, 2014/10/07