Patchwork Re: [patch uq/master 2/2] kvm-all.c: define smp_wmb and use it for coalesced mmio

login
register
mail settings
Submitter Marcelo Tosatti
Date Feb. 22, 2010, 4:57 p.m.
Message ID <20100222165754.GA24872@amt.cnet>
Download mbox | patch
Permalink /patch/45974/
State New
Headers show

Comments

Marcelo Tosatti - Feb. 22, 2010, 4:57 p.m.
Acked-by: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Avi Kivity - Feb. 22, 2010, 5:04 p.m.
On 02/22/2010 06:57 PM, Marcelo Tosatti wrote:
> Acked-by: "Michael S. Tsirkin"<mst@redhat.com>
> Signed-off-by: Marcelo Tosatti<mtosatti@redhat.com>
>    

Applied, thanks.

Patch

Index: qemu/kvm-all.c
===================================================================
--- qemu.orig/kvm-all.c
+++ qemu/kvm-all.c
@@ -21,6 +21,7 @@ 
 #include <linux/kvm.h>
 
 #include "qemu-common.h"
+#include "qemu-barrier.h"
 #include "sysemu.h"
 #include "hw/hw.h"
 #include "gdbstub.h"
@@ -730,7 +731,7 @@  void kvm_flush_coalesced_mmio_buffer(voi
             ent = &ring->coalesced_mmio[ring->first];
 
             cpu_physical_memory_write(ent->phys_addr, ent->data, ent->len);
-            /* FIXME smp_wmb() */
+            smp_wmb();
             ring->first = (ring->first + 1) % KVM_COALESCED_MMIO_MAX;
         }
     }
Index: qemu/qemu-barrier.h
===================================================================
--- /dev/null
+++ qemu/qemu-barrier.h
@@ -0,0 +1,7 @@ 
+#ifndef __QEMU_BARRIER_H
+#define __QEMU_BARRIER_H 1
+
+/* FIXME: arch dependant, x86 version */
+#define smp_wmb()   asm volatile("" ::: "memory")
+
+#endif