* [PATCH 0/2] virtio-ccw: new status accessor in device
@ 2016-04-11 11:23 Cornelia Huck
2016-04-11 11:23 ` [PATCH 1/2] s390x/virtio-ccw: respond to READ_STATUS command Cornelia Huck
2016-04-11 11:23 ` [PATCH 2/2] s390x/virtio-ccw: set revision 2 as maximum revision number Cornelia Huck
0 siblings, 2 replies; 3+ messages in thread
From: Cornelia Huck @ 2016-04-11 11:23 UTC (permalink / raw)
To: virtio-dev, virtualization, qemu-devel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] s390x/virtio-ccw: respond to READ_STATUS command
2016-04-11 11:23 [PATCH 0/2] virtio-ccw: new status accessor in device Cornelia Huck
@ 2016-04-11 11:23 ` Cornelia Huck
2016-04-11 11:23 ` [PATCH 2/2] s390x/virtio-ccw: set revision 2 as maximum revision number Cornelia Huck
1 sibling, 0 replies; 3+ messages in thread
From: Cornelia Huck @ 2016-04-11 11:23 UTC (permalink / raw)
To: virtio-dev, virtualization, qemu-devel; +Cc: Pierre Morel
From: Pierre Morel <pmorel@linux.vnet.ibm.com>
This patch adds the response to the READ_STATUS CCW command.
Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@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
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 2/2] s390x/virtio-ccw: set revision 2 as maximum revision number
2016-04-11 11:23 [PATCH 0/2] virtio-ccw: new status accessor in device Cornelia Huck
2016-04-11 11:23 ` [PATCH 1/2] s390x/virtio-ccw: respond to READ_STATUS command Cornelia Huck
@ 2016-04-11 11:23 ` Cornelia Huck
1 sibling, 0 replies; 3+ messages in thread
From: Cornelia Huck @ 2016-04-11 11:23 UTC (permalink / raw)
To: virtio-dev, virtualization, qemu-devel; +Cc: Pierre Morel
From: Pierre Morel <pmorel@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@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-11 11:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-11 11:23 [PATCH 0/2] virtio-ccw: new status accessor in device Cornelia Huck
2016-04-11 11:23 ` [PATCH 1/2] s390x/virtio-ccw: respond to READ_STATUS command Cornelia Huck
2016-04-11 11:23 ` [PATCH 2/2] s390x/virtio-ccw: set revision 2 as maximum revision number Cornelia Huck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox