]> git.proxmox.com Git - mirror_qemu.git/commit - hw/virtio.c
virtio: Use global memory barrier macros
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 20 Sep 2011 02:05:20 +0000 (12:05 +1000)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 23 Sep 2011 16:51:05 +0000 (11:51 -0500)
commitb90d2f35125490b8f62484c5ea7e6bbecbe43b6f
treec084ffd8b99ea4afb249cabdb95ce9e101f3ff9f
parent87751797c707092108700159b570e917bae346b9
virtio: Use global memory barrier macros

The virtio code uses wmb() macros in several places, as required by the
SMP-aware virtio protocol.  However the wmb() macro is locally defined
to be a compiler barrier only.  This is probably sufficient on x86
due to its strong storage ordering model, but it certainly isn't on other
platforms, such as ppc.

In any case, qemu already has some globally defined memory barrier macros
in qemu-barrier.h.  This patch, therefore converts virtio.c to use those
barrier macros.  The macros in qemu-barrier.h are also wrong (or at least,
safe for x86 only) but this way at least there's only one place to fix
them.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/virtio.c