]> xenbits.xensource.com Git - seabios.git/commit
virtio: clean up memory barrier usage
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 20 May 2010 13:36:32 +0000 (16:36 +0300)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 27 May 2010 00:52:06 +0000 (20:52 -0400)
commit0f3783b3cc9be767182bce8e7aeadab64db4e0aa
treeb893dc2ecc86e3027b8162a135fb90773bdc23f3
parentbfe4d6044c579e4b66566d10b4e25f3297f6c4ab
virtio: clean up memory barrier usage

cleanup memory barrier usage bringing it
in sync with what linux guest does.
The rules are simple:
- read barrier after index read
- write barrier before index write
Also, call macros smp_rmb/smp_wmb to stress
we are not syncing with a real io device here.

While I don't think compiler is crazy/powerful
enough to reorder these, anyway, the bogus
barriers we currently have in code will confuse
anyone who tries to copy/reuse it.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>
src/virtio-ring.c
src/virtio-ring.h