]> xenbits.xensource.com Git - seabios.git/commitdiff
virtio: remove NO_NOTIFY optimization
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 20 May 2010 13:24:48 +0000 (16:24 +0300)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 27 May 2010 00:51:44 +0000 (20:51 -0400)
NO_NOTIFY is an optimization to reduce the number of exits,
but using it requires careful synchronization with host,
forcing read/write ordering for the CPU. Otherwise we
risk not kicking a host when it is waiting for more buffers,
resulting in a deadlock.

Let's just always kick, it's way simpler.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
src/virtio-ring.c

index 7565688998379cd0e59e49cf772e67754ea02096..493d8b5e983ae648b98ffad311b5472ddc43bf4c 100644 (file)
@@ -143,12 +143,10 @@ void vring_kick(unsigned int ioaddr, struct vring_virtqueue *vq, int num_added)
 {
     struct vring *vr = &vq->vring;
     struct vring_avail *avail = GET_FLATPTR(vr->avail);
-    struct vring_used *used = GET_FLATPTR(vq->vring.used);
 
     wmb();
     SET_FLATPTR(avail->idx, GET_FLATPTR(avail->idx) + num_added);
 
     mb();
-    if (!(GET_FLATPTR(used->flags) & VRING_USED_F_NO_NOTIFY))
-        vp_notify(ioaddr, GET_FLATPTR(vq->queue_index));
+    vp_notify(ioaddr, GET_FLATPTR(vq->queue_index));
 }