aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorHeinz Graalfs <graalfs@linux.vnet.ibm.com>2013-10-28 19:08:50 -0400
committerRusty Russell <rusty@rustcorp.com.au>2013-10-28 20:58:11 -0400
commit46f9c2b925ac12e5ad8b8b7c90c71dacc9d5db37 (patch)
tree39b9bd752cb3cb43a5e11d4f0fc35f425f1d02e2 /drivers/s390
parent630b54d33493d1f67e79b148b5e361c5bbd3f29d (diff)
virtio_ring: change host notification API
Currently a host kick error is silently ignored and not reflected in the virtqueue of a particular virtio device. Changing the notify API for guest->host notification seems to be one prerequisite in order to be able to handle such errors in the context where the kick is triggered. This patch changes the notify API. The notify function must return a bool return value. It returns false if the host notification failed. Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/kvm/kvm_virtio.c8
-rw-r--r--drivers/s390/kvm/virtio_ccw.c5
2 files changed, 10 insertions, 3 deletions
diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c
index af2166fa5159..1abd0db29915 100644
--- a/drivers/s390/kvm/kvm_virtio.c
+++ b/drivers/s390/kvm/kvm_virtio.c
@@ -166,11 +166,15 @@ static void kvm_reset(struct virtio_device *vdev)
166 * make a hypercall. We hand the address of the virtqueue so the Host 166 * make a hypercall. We hand the address of the virtqueue so the Host
167 * knows which virtqueue we're talking about. 167 * knows which virtqueue we're talking about.
168 */ 168 */
169static void kvm_notify(struct virtqueue *vq) 169static bool kvm_notify(struct virtqueue *vq)
170{ 170{
171 long rc;
171 struct kvm_vqconfig *config = vq->priv; 172 struct kvm_vqconfig *config = vq->priv;
172 173
173 kvm_hypercall1(KVM_S390_VIRTIO_NOTIFY, config->address); 174 rc = kvm_hypercall1(KVM_S390_VIRTIO_NOTIFY, config->address);
175 if (rc < 0)
176 return false;
177 return true;
174} 178}
175 179
176/* 180/*
diff --git a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c
index 779dc5136291..d6297176ab85 100644
--- a/drivers/s390/kvm/virtio_ccw.c
+++ b/drivers/s390/kvm/virtio_ccw.c
@@ -162,7 +162,7 @@ static inline long do_kvm_notify(struct subchannel_id schid,
162 return __rc; 162 return __rc;
163} 163}
164 164
165static void virtio_ccw_kvm_notify(struct virtqueue *vq) 165static bool virtio_ccw_kvm_notify(struct virtqueue *vq)
166{ 166{
167 struct virtio_ccw_vq_info *info = vq->priv; 167 struct virtio_ccw_vq_info *info = vq->priv;
168 struct virtio_ccw_device *vcdev; 168 struct virtio_ccw_device *vcdev;
@@ -171,6 +171,9 @@ static void virtio_ccw_kvm_notify(struct virtqueue *vq)
171 vcdev = to_vc_device(info->vq->vdev); 171 vcdev = to_vc_device(info->vq->vdev);
172 ccw_device_get_schid(vcdev->cdev, &schid); 172 ccw_device_get_schid(vcdev->cdev, &schid);
173 info->cookie = do_kvm_notify(schid, vq->index, info->cookie); 173 info->cookie = do_kvm_notify(schid, vq->index, info->cookie);
174 if (info->cookie < 0)
175 return false;
176 return true;
174} 177}
175 178
176static int virtio_ccw_read_vq_conf(struct virtio_ccw_device *vcdev, 179static int virtio_ccw_read_vq_conf(struct virtio_ccw_device *vcdev,