* [Qemu-devel] [PATCH RFC 0/2] virtio-ccw: new status accessor in device
@ 2015-09-11 13:58 Cornelia Huck
2015-09-11 13:58 ` [PATCH RFC 1/2] s390x/virtio-ccw: respond to READ_STATUS command Cornelia Huck
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Cornelia Huck @ 2015-09-11 13:58 UTC (permalink / raw)
To: virtio-dev, virtualization, qemu-devel; +Cc: Cornelia Huck
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH RFC 1/2] s390x/virtio-ccw: respond to READ_STATUS command
2015-09-11 13:58 [Qemu-devel] [PATCH RFC 0/2] virtio-ccw: new status accessor in device Cornelia Huck
2015-09-11 13:58 ` [PATCH RFC 1/2] s390x/virtio-ccw: respond to READ_STATUS command Cornelia Huck
@ 2015-09-11 13:58 ` Cornelia Huck
2015-09-11 13:58 ` [PATCH RFC 2/2] s390x/virtio-ccw: set revision 2 as maximum revision number Cornelia Huck
2015-09-11 13:58 ` [Qemu-devel] " Cornelia Huck
3 siblings, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2015-09-11 13:58 UTC (permalink / raw)
To: virtio-dev, virtualization, qemu-devel; +Cc: Cornelia Huck, 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 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH RFC 1/2] s390x/virtio-ccw: respond to READ_STATUS command
2015-09-11 13:58 [Qemu-devel] [PATCH RFC 0/2] virtio-ccw: new status accessor in device Cornelia Huck
@ 2015-09-11 13:58 ` Cornelia Huck
2015-09-11 13:58 ` [Qemu-devel] " Cornelia Huck
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2015-09-11 13:58 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 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH RFC 2/2] s390x/virtio-ccw: set revision 2 as maximum revision number
2015-09-11 13:58 [Qemu-devel] [PATCH RFC 0/2] virtio-ccw: new status accessor in device Cornelia Huck
` (2 preceding siblings ...)
2015-09-11 13:58 ` [PATCH RFC 2/2] s390x/virtio-ccw: set revision 2 as maximum revision number Cornelia Huck
@ 2015-09-11 13:58 ` Cornelia Huck
3 siblings, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2015-09-11 13:58 UTC (permalink / raw)
To: virtio-dev, virtualization, qemu-devel; +Cc: Cornelia Huck, 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 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH RFC 2/2] s390x/virtio-ccw: set revision 2 as maximum revision number
2015-09-11 13:58 [Qemu-devel] [PATCH RFC 0/2] virtio-ccw: new status accessor in device Cornelia Huck
2015-09-11 13:58 ` [PATCH RFC 1/2] s390x/virtio-ccw: respond to READ_STATUS command Cornelia Huck
2015-09-11 13:58 ` [Qemu-devel] " Cornelia Huck
@ 2015-09-11 13:58 ` Cornelia Huck
2015-09-11 13:58 ` [Qemu-devel] " Cornelia Huck
3 siblings, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2015-09-11 13:58 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 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-09-11 13:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-11 13:58 [Qemu-devel] [PATCH RFC 0/2] virtio-ccw: new status accessor in device Cornelia Huck
2015-09-11 13:58 ` [PATCH RFC 1/2] s390x/virtio-ccw: respond to READ_STATUS command Cornelia Huck
2015-09-11 13:58 ` [Qemu-devel] " Cornelia Huck
2015-09-11 13:58 ` [PATCH RFC 2/2] s390x/virtio-ccw: set revision 2 as maximum revision number Cornelia Huck
2015-09-11 13:58 ` [Qemu-devel] " Cornelia Huck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.