Skip to content

Commit

Permalink
Merge tag 'for-linus' of git://github.com/rustyrussell/linux
Browse files Browse the repository at this point in the history
* tag 'for-linus' of git://github.com/rustyrussell/linux:
  lguest: remove reference from Documentation/virtual/00-INDEX
  virtio: correct the memory barrier in virtqueue_kick_prepare()
  virtio: fix typos of memory barriers
  • Loading branch information
Linus Torvalds committed Jan 29, 2012
2 parents 6c334f4 + 13289d5 commit e3b8369
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions Documentation/virtual/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Virtualization support in the Linux kernel.
- this file.
kvm/
- Kernel Virtual Machine. See also http://linux-kvm.org
lguest/
- Extremely simple hypervisor for experimental/educational use.
uml/
- User Mode Linux, builds/runs Linux kernel as a userspace program.
virtio.txt
Expand Down
8 changes: 4 additions & 4 deletions drivers/virtio/virtio_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#define virtio_rmb(vq) \
do { if ((vq)->weak_barriers) smp_rmb(); else rmb(); } while(0)
#define virtio_wmb(vq) \
do { if ((vq)->weak_barriers) smp_rmb(); else rmb(); } while(0)
do { if ((vq)->weak_barriers) smp_wmb(); else wmb(); } while(0)
#else
/* We must force memory ordering even if guest is UP since host could be
* running on another CPU, but SMP barriers are defined to barrier() in that
Expand Down Expand Up @@ -308,9 +308,9 @@ bool virtqueue_kick_prepare(struct virtqueue *_vq)
bool needs_kick;

START_USE(vq);
/* Descriptors and available array need to be set before we expose the
* new available array entries. */
virtio_wmb(vq);
/* We need to expose available array entries before checking avail
* event. */
virtio_mb(vq);

old = vq->vring.avail->idx - vq->num_added;
new = vq->vring.avail->idx;
Expand Down

0 comments on commit e3b8369

Please sign in to comment.