Cornelia Huck
2015-Sep-11 13:58 UTC
[PATCH RFC 0/2] virtio-ccw: new status accessor in device
These patches implement the new read status command in qemu and bump the revision to 2 (as this ccw is currently the only thing new with that revision). Patches are on top of v2 of "virtio-1/virtio-ccw related patches". Pierre Morel (2): s390x/virtio-ccw: respond to READ_STATUS command s390x/virtio-ccw: set revision 2 as maximum revision number hw/s390x/virtio-ccw.c | 20 ++++++++++++++++++++ hw/s390x/virtio-ccw.h | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) -- 2.3.8
Cornelia Huck
2015-Sep-11 13:58 UTC
[PATCH RFC 1/2] s390x/virtio-ccw: respond to READ_STATUS command
From: Pierre Morel <pmorel at linux.vnet.ibm.com> This patch adds the response to the READ_STATUS CCW command. Signed-off-by: Pierre Morel <pmorel at linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck at de.ibm.com> --- hw/s390x/virtio-ccw.c | 20 ++++++++++++++++++++ hw/s390x/virtio-ccw.h | 1 + 2 files changed, 21 insertions(+) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index fb103b7..dcd0fff 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -586,6 +586,26 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) } } break; + case CCW_CMD_READ_STATUS: + if (check_len) { + if (ccw.count != sizeof(status)) { + ret = -EINVAL; + break; + } + } else if (ccw.count < sizeof(status)) { + /* Can't execute command. */ + ret = -EINVAL; + break; + } + if (!ccw.cda) { + ret = -EFAULT; + } else { + address_space_stb(&address_space_memory, ccw.cda, vdev->status, + MEMTXATTRS_UNSPECIFIED, NULL); + sch->curr_status.scsw.count = ccw.count - sizeof(vdev->status);; + ret = 0; + } + break; case CCW_CMD_WRITE_STATUS: if (check_len) { if (ccw.count != sizeof(status)) { diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h index 7ab8367..453fdf7 100644 --- a/hw/s390x/virtio-ccw.h +++ b/hw/s390x/virtio-ccw.h @@ -40,6 +40,7 @@ #define CCW_CMD_SET_IND 0x43 #define CCW_CMD_SET_CONF_IND 0x53 #define CCW_CMD_READ_VQ_CONF 0x32 +#define CCW_CMD_READ_STATUS 0x72 #define CCW_CMD_SET_IND_ADAPTER 0x73 #define CCW_CMD_SET_VIRTIO_REV 0x83 -- 2.3.8
Cornelia Huck
2015-Sep-11 13:58 UTC
[PATCH RFC 2/2] s390x/virtio-ccw: set revision 2 as maximum revision number
From: Pierre Morel <pmorel at linux.vnet.ibm.com> We have everything needed for virtio-ccw revision 2 wired up now. Bump the maximum supported revision reported to the guest so they can make use of it. Signed-off-by: Pierre Morel <pmorel at linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck at de.ibm.com> --- hw/s390x/virtio-ccw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h index 453fdf7..da07bfa 100644 --- a/hw/s390x/virtio-ccw.h +++ b/hw/s390x/virtio-ccw.h @@ -104,7 +104,7 @@ struct VirtioCcwDevice { }; /* The maximum virtio revision we support. */ -#define VIRTIO_CCW_MAX_REV 1 +#define VIRTIO_CCW_MAX_REV 2 static inline int virtio_ccw_rev_max(VirtioCcwDevice *dev) { return dev->max_rev; -- 2.3.8
Seemingly Similar Threads
- [PATCH RFC 0/2] virtio-ccw: new status accessor in device
- [PATCH 0/2] virtio-ccw: new status accessor in device
- [PATCH 0/2] virtio-ccw: new status accessor in device
- [PATCH 0/1] virtio_ccw: new status accessor in driver
- [PATCH 0/1] virtio_ccw: new status accessor in driver