[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v5 14/19] s390x/virtio-ccw: enable virtio 1.
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH RFC v5 14/19] s390x/virtio-ccw: enable virtio 1.0 |
Date: |
Tue, 9 Dec 2014 15:46:46 +0200 |
On Tue, Dec 02, 2014 at 02:00:22PM +0100, Cornelia Huck wrote:
> virtio-ccw should now have everything in place to operate virtio 1.0
> devices, so let's enable revision 1.
>
> Signed-off-by: Cornelia Huck <address@hidden>
Looks like this will allow revision 1 for all devices,
we only want this for virtio 1 devices.
The following should fix it I think:
Signed-off-by: Michael S. Tsirkin <address@hidden>
diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index d40e3be..f5a1d3e 100644
--- a/hw/s390x/virtio-ccw.h
+++ b/hw/s390x/virtio-ccw.h
@@ -69,9 +69,6 @@ typedef struct VirtIOCCWDeviceClass {
int (*exit)(VirtioCcwDevice *dev);
} VirtIOCCWDeviceClass;
-/* The maximum virtio revision we support. */
-#define VIRTIO_CCW_REV_MAX 1
-
/* Performance improves when virtqueue kick processing is decoupled from the
* vcpu thread using ioeventfd for some devices. */
#define VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT 1
@@ -104,6 +101,12 @@ struct VirtioCcwDevice {
uint64_t ind_bit;
};
+/* The maximum virtio revision we support. */
+static int virtio_ccw_rev_max(VirtioCcwDevice *dev)
+{
+ return dev->host_features & (1ULL << VIRTIO_F_VERSION_1) ? 1 : 0;
+}
+
/* virtual css bus type */
typedef struct VirtualCssBus {
BusState parent_obj;
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 3826074..922b021 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -693,7 +693,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
}
cpu_physical_memory_read(ccw.cda, &revinfo, len);
if (dev->revision >= 0 ||
- revinfo.revision > VIRTIO_CCW_REV_MAX) {
+ revinfo.revision > virtio_ccw_rev_max(dev)) {
ret = -ENOSYS;
break;
}
- [Qemu-devel] [PATCH RFC v5 08/19] dataplane: allow virtio-1 devices, (continued)
- [Qemu-devel] [PATCH RFC v5 08/19] dataplane: allow virtio-1 devices, Cornelia Huck, 2014/12/02
- [Qemu-devel] [PATCH RFC v5 09/19] s390x/css: Add a callback for when subchannel gets disabled, Cornelia Huck, 2014/12/02
- [Qemu-devel] [PATCH RFC v5 12/19] virtio: disallow late feature changes for virtio-1, Cornelia Huck, 2014/12/02
- [Qemu-devel] [PATCH RFC v5 11/19] s390x/virtio-ccw: support virtio-1 set_vq format, Cornelia Huck, 2014/12/02
- [Qemu-devel] [PATCH RFC v5 10/19] s390x/virtio-ccw: add virtio set-revision call, Cornelia Huck, 2014/12/02
- [Qemu-devel] [PATCH RFC v5 13/19] virtio: allow to fail setting status, Cornelia Huck, 2014/12/02
- [Qemu-devel] [PATCH RFC v5 15/19] virtio-net: no writeable mac for virtio-1, Cornelia Huck, 2014/12/02
- [Qemu-devel] [PATCH RFC v5 14/19] s390x/virtio-ccw: enable virtio 1.0, Cornelia Huck, 2014/12/02
- Re: [Qemu-devel] [PATCH RFC v5 14/19] s390x/virtio-ccw: enable virtio 1.0,
Michael S. Tsirkin <=
- [Qemu-devel] [PATCH RFC v5 16/19] virtio-net: support longer header, Cornelia Huck, 2014/12/02
- [Qemu-devel] [PATCH RFC v5 17/19] virtio-net: enable virtio 1.0, Cornelia Huck, 2014/12/02
- [Qemu-devel] [PATCH RFC v5 18/19] virtio: support revision-specific features, Cornelia Huck, 2014/12/02
- [Qemu-devel] [PATCH RFC v5 19/19] virtio-blk: revision specific feature bits, Cornelia Huck, 2014/12/02