From: Michael S. Tsirkin Date: Thu, 20 May 2010 13:24:48 +0000 (+0300) Subject: virtio: remove NO_NOTIFY optimization X-Git-Tag: rel-0.6.1~64 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bfe4d6044c579e4b66566d10b4e25f3297f6c4ab;p=seabios.git virtio: remove NO_NOTIFY optimization 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 Cc: Gleb Natapov --- diff --git a/src/virtio-ring.c b/src/virtio-ring.c index 7565688..493d8b5 100644 --- a/src/virtio-ring.c +++ b/src/virtio-ring.c @@ -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)); }