[PATCH 2/2] virtio: correct the memory barrier in virtqueue_kick_prepare()

2012-01-20 Thread Jason Wang
Use virtio_mb() to make sure the available index to be exposed before checking the the avail event. Otherwise we may get stale value of avail event in guest and never kick the host after. Signed-off-by: Jason Wang --- drivers/virtio/virtio_ring.c |6 +++--- 1 files changed, 3 insertions(+),

Re: [PATCH 2/2] virtio: correct the memory barrier in virtqueue_kick_prepare()

2012-01-22 Thread Michael S. Tsirkin
On Fri, Jan 20, 2012 at 04:17:08PM +0800, Jason Wang wrote: > Use virtio_mb() to make sure the available index to be exposed before > checking the the avail event. Otherwise we may get stale value of > avail event in guest and never kick the host after. > > Signed-off-by: Jason Wang Good catch.

Re: [PATCH 2/2] virtio: correct the memory barrier in virtqueue_kick_prepare()

2012-01-22 Thread Rusty Russell
On Sun, 22 Jan 2012 13:47:57 +0200, "Michael S. Tsirkin" wrote: > On Fri, Jan 20, 2012 at 04:17:08PM +0800, Jason Wang wrote: > > Use virtio_mb() to make sure the available index to be exposed before > > checking the the avail event. Otherwise we may get stale value of > > avail event in guest an