virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] virtio-ccw: updates
@ 2019-01-21 12:19 Cornelia Huck
  2019-01-21 12:19 ` [PATCH 1/3] virtio-ccw: diag 500 may return a negative cookie Cornelia Huck
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Cornelia Huck @ 2019-01-21 12:19 UTC (permalink / raw)
  To: Michael S . Tsirkin
  Cc: linux-s390, kvm, Cornelia Huck, virtualization, Halil Pasic

[Now not as pull request, as requested. The first patch had already been
in my last pull request. Patches are against master, but should apply
basically anywhere.

Git branch:
git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git virtio-ccw]

Some updates: documentation, gracefully handle invalid queues, and wire
up the ->bus_name callback (which had somehow fallen through the cracks.)

Cornelia Huck (2):
  virtio-ccw: diag 500 may return a negative cookie
  virtio-ccw: wire up ->bus_name callback

Halil Pasic (1):
  s390/virtio: handle find on invalid queue gracefully

 Documentation/virtual/kvm/s390-diag.txt |  3 ++-
 drivers/s390/virtio/virtio_ccw.c        | 12 +++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

-- 
2.17.2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] virtio-ccw: diag 500 may return a negative cookie
  2019-01-21 12:19 [PATCH 0/3] virtio-ccw: updates Cornelia Huck
@ 2019-01-21 12:19 ` Cornelia Huck
  2019-01-21 12:19 ` [PATCH 2/3] s390/virtio: handle find on invalid queue gracefully Cornelia Huck
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2019-01-21 12:19 UTC (permalink / raw)
  To: Michael S . Tsirkin
  Cc: linux-s390, kvm, Cornelia Huck, virtualization, Halil Pasic

If something goes wrong in the kvm io bus handling, the virtio-ccw
diagnose may return a negative error value in the cookie gpr.

Document this.

Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 Documentation/virtual/kvm/s390-diag.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/virtual/kvm/s390-diag.txt b/Documentation/virtual/kvm/s390-diag.txt
index 48c4921794ed..7c52e5f8b210 100644
--- a/Documentation/virtual/kvm/s390-diag.txt
+++ b/Documentation/virtual/kvm/s390-diag.txt
@@ -68,7 +68,8 @@ Subcode 3 - virtio-ccw notification
     identifier, it is ignored.
 
     After completion of the DIAGNOSE call, general register 2 may contain
-    a 64bit identifier (in the kvm_io_bus cookie case).
+    a 64bit identifier (in the kvm_io_bus cookie case), or a negative
+    error value, if an internal error occurred.
 
     See also the virtio standard for a discussion of this hypercall.
 
-- 
2.17.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] s390/virtio: handle find on invalid queue gracefully
  2019-01-21 12:19 [PATCH 0/3] virtio-ccw: updates Cornelia Huck
  2019-01-21 12:19 ` [PATCH 1/3] virtio-ccw: diag 500 may return a negative cookie Cornelia Huck
@ 2019-01-21 12:19 ` Cornelia Huck
  2019-01-21 12:19 ` [PATCH 3/3] virtio-ccw: wire up ->bus_name callback Cornelia Huck
  2019-01-21 19:30 ` [PATCH 0/3] virtio-ccw: updates Michael S. Tsirkin
  3 siblings, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2019-01-21 12:19 UTC (permalink / raw)
  To: Michael S . Tsirkin
  Cc: linux-s390, kvm, Cornelia Huck, virtualization, Halil Pasic

From: Halil Pasic <pasic@linux.ibm.com>

A queue with a capacity of zero is clearly not a valid virtio queue.
Some emulators report zero queue size if queried with an invalid queue
index. Instead of crashing in this case let us just return -ENOENT. To
make that work properly, let us fix the notifier cleanup logic as well.

Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Message-Id: <20190107123147.97038-1-pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 drivers/s390/virtio/virtio_ccw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
index ae1d56da671d..1a738fe9f26b 100644
--- a/drivers/s390/virtio/virtio_ccw.c
+++ b/drivers/s390/virtio/virtio_ccw.c
@@ -272,6 +272,8 @@ static void virtio_ccw_drop_indicators(struct virtio_ccw_device *vcdev)
 {
 	struct virtio_ccw_vq_info *info;
 
+	if (!vcdev->airq_info)
+		return;
 	list_for_each_entry(info, &vcdev->virtqueues, node)
 		drop_airq_indicator(info->vq, vcdev->airq_info);
 }
@@ -413,7 +415,7 @@ static int virtio_ccw_read_vq_conf(struct virtio_ccw_device *vcdev,
 	ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_READ_VQ_CONF);
 	if (ret)
 		return ret;
-	return vcdev->config_block->num;
+	return vcdev->config_block->num ?: -ENOENT;
 }
 
 static void virtio_ccw_del_vq(struct virtqueue *vq, struct ccw1 *ccw)
-- 
2.17.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] virtio-ccw: wire up ->bus_name callback
  2019-01-21 12:19 [PATCH 0/3] virtio-ccw: updates Cornelia Huck
  2019-01-21 12:19 ` [PATCH 1/3] virtio-ccw: diag 500 may return a negative cookie Cornelia Huck
  2019-01-21 12:19 ` [PATCH 2/3] s390/virtio: handle find on invalid queue gracefully Cornelia Huck
@ 2019-01-21 12:19 ` Cornelia Huck
  2019-01-21 19:30 ` [PATCH 0/3] virtio-ccw: updates Michael S. Tsirkin
  3 siblings, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2019-01-21 12:19 UTC (permalink / raw)
  To: Michael S . Tsirkin
  Cc: linux-s390, kvm, Cornelia Huck, virtualization, Halil Pasic

Return the bus id of the ccw proxy device. This makes 'ethtool -i'
show a more useful value than 'virtio' in the bus-info field.

Acked-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 drivers/s390/virtio/virtio_ccw.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
index 1a738fe9f26b..74c328321889 100644
--- a/drivers/s390/virtio/virtio_ccw.c
+++ b/drivers/s390/virtio/virtio_ccw.c
@@ -975,6 +975,13 @@ static void virtio_ccw_set_status(struct virtio_device *vdev, u8 status)
 	kfree(ccw);
 }
 
+static const char *virtio_ccw_bus_name(struct virtio_device *vdev)
+{
+	struct virtio_ccw_device *vcdev = to_vc_device(vdev);
+
+	return dev_name(&vcdev->cdev->dev);
+}
+
 static const struct virtio_config_ops virtio_ccw_config_ops = {
 	.get_features = virtio_ccw_get_features,
 	.finalize_features = virtio_ccw_finalize_features,
@@ -985,6 +992,7 @@ static const struct virtio_config_ops virtio_ccw_config_ops = {
 	.reset = virtio_ccw_reset,
 	.find_vqs = virtio_ccw_find_vqs,
 	.del_vqs = virtio_ccw_del_vqs,
+	.bus_name = virtio_ccw_bus_name,
 };
 
 
-- 
2.17.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] virtio-ccw: updates
  2019-01-21 12:19 [PATCH 0/3] virtio-ccw: updates Cornelia Huck
                   ` (2 preceding siblings ...)
  2019-01-21 12:19 ` [PATCH 3/3] virtio-ccw: wire up ->bus_name callback Cornelia Huck
@ 2019-01-21 19:30 ` Michael S. Tsirkin
  3 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2019-01-21 19:30 UTC (permalink / raw)
  To: Cornelia Huck; +Cc: Halil Pasic, linux-s390, kvm, virtualization

On Mon, Jan 21, 2019 at 01:19:41PM +0100, Cornelia Huck wrote:
> [Now not as pull request, as requested. The first patch had already been
> in my last pull request. Patches are against master, but should apply
> basically anywhere.
> 
> Git branch:
> git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git virtio-ccw]
> 
> Some updates: documentation, gracefully handle invalid queues, and wire
> up the ->bus_name callback (which had somehow fallen through the cracks.)

Thanks, will queue.

> Cornelia Huck (2):
>   virtio-ccw: diag 500 may return a negative cookie
>   virtio-ccw: wire up ->bus_name callback
> 
> Halil Pasic (1):
>   s390/virtio: handle find on invalid queue gracefully
> 
>  Documentation/virtual/kvm/s390-diag.txt |  3 ++-
>  drivers/s390/virtio/virtio_ccw.c        | 12 +++++++++++-
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> -- 
> 2.17.2

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-21 19:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-21 12:19 [PATCH 0/3] virtio-ccw: updates Cornelia Huck
2019-01-21 12:19 ` [PATCH 1/3] virtio-ccw: diag 500 may return a negative cookie Cornelia Huck
2019-01-21 12:19 ` [PATCH 2/3] s390/virtio: handle find on invalid queue gracefully Cornelia Huck
2019-01-21 12:19 ` [PATCH 3/3] virtio-ccw: wire up ->bus_name callback Cornelia Huck
2019-01-21 19:30 ` [PATCH 0/3] virtio-ccw: updates Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).