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); see "[PATCH v2 1/1] ccw: add CCW_CMD_READ_STATUS" for details. Note that we'll need to add some compat machine handling when this is added (not done here, as the machine level is not clear yet). Changes from the RFC (back in September): - removed stray ';' in patch 1 - rebased 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.6.6
Cornelia Huck
2016-Apr-11 11:23 UTC
[PATCH 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 d51642d..569ab26 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -525,6 +525,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 66c831b..6bc14ee 100644 --- a/hw/s390x/virtio-ccw.h +++ b/hw/s390x/virtio-ccw.h @@ -41,6 +41,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.6.6
Cornelia Huck
2016-Apr-11 11:23 UTC
[PATCH 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 6bc14ee..46b5ee6 100644 --- a/hw/s390x/virtio-ccw.h +++ b/hw/s390x/virtio-ccw.h @@ -97,7 +97,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.6.6
Possibly Parallel Threads
- [PATCH 0/2] virtio-ccw: new status accessor in device
- [PATCH RFC 0/2] virtio-ccw: new status accessor in device
- [PATCH RFC 0/2] virtio-ccw: new status accessor in device
- [PATCH 1/2] s390x/virtio-ccw: respond to READ_STATUS command
- [PATCH 0/1] virtio_ccw: new status accessor in driver