virtio: order used ring after used index read
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 25 Oct 2009 13:28:53 +0000 (15:28 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 28 Oct 2009 22:20:37 +0000 (08:50 +1030)
commit2d61ba95034f1abbdec7729d52c740870a5eddb6
treeec51d4cba4240af6011f4fabfda06a21532761da
parent0b22bd0ba0d500ab40e7673c591c594ec5447342
virtio: order used ring after used index read

On SMP guests, reads from the ring might bypass used index reads. This
causes guest crashes because host writes to used index to signal ring
data readiness.  Fix this by inserting rmb before used ring reads.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
drivers/virtio/virtio_ring.c