[PATCH] viostor driver.Add memory barrier - synch with fix for Linux guests by Michael S. Tsirkin <mst@xxxxxxxxxx>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




repository: /home/vadimr/shares/kvm-guest-drivers-windows
branch: XP
commit 6906acfc2d5f58df43ebc9c190e1447ff6e63a01
Author: Vadim Rozenfeld<vrozenfe@xxxxxxxxxx>
Date:   Sun Nov 1 11:54:03 2009 +0200

    [PATCH] viostor driver.Add memory read barrier - synch with fix for Linux guests by Michael S. Tsirkin<mst@xxxxxxxxxx>

    Signed-off-by: Vadim Rozenfeld<vrozenfe@xxxxxxxxxx>

diff --git a/viostor/virtio_ring.c b/viostor/virtio_ring.c
index d099bb8..2911cef 100644
--- a/viostor/virtio_ring.c
+++ b/viostor/virtio_ring.c
@@ -237,6 +237,8 @@ vring_get_buf(
         return NULL;
     }

+    rmb();
+
     i = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].id;
     *len = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].len;


diff --git a/viostor/virtio_ring.c b/viostor/virtio_ring.c
index d099bb8..2911cef 100644
--- a/viostor/virtio_ring.c
+++ b/viostor/virtio_ring.c
@@ -237,6 +237,8 @@ vring_get_buf(
         return NULL;
     }
 
+    rmb();
+
     i = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].id;
     *len = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].len;
 

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux