virtio: order used ring after used index read
commit48fe10afb355d88be5a9c0b7d5a198c5e5b9b4aa
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 25 Oct 2009 13:28:53 +0000 (25 15:28 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Nov 2009 00:22:28 +0000 (9 16:22 -0800)
tree2c5a5cd8ca0d0e0821b31177883bf727f85be0d6
parentbed202356361d3620a51974eadca78261e049ef0
virtio: order used ring after used index read

commit 2d61ba95034f1abbdec7729d52c740870a5eddb6 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/virtio/virtio_ring.c