Re: [Qemu-devel] [PATCH] Add a memory barrier to guest memory access function

2012-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2012 at 08:56:12AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2012-05-22 at 01:22 +0300, Michael S. Tsirkin wrote: > > > Again, from which originator ? From a given initiator, nothing > > bypasses > > > anything, so the right thing to do here is a full mb(). However, I > > > sus

Re: [Qemu-devel] [PATCH] Add a memory barrier to guest memory access function

2012-05-21 Thread Rusty Russell
On Tue, 22 May 2012 07:58:17 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2012-05-21 at 15:18 +0300, Michael S. Tsirkin wrote: > > But I can also live with a global flag "latest_dma_read" > > and on read we could do > > if (unlikely(latest_dma_read)) > > smp_mb(); > > > > if yo

Re: [Qemu-devel] [PATCH] Add a memory barrier to guest memory access function

2012-05-21 Thread Benjamin Herrenschmidt
On Tue, 2012-05-22 at 01:22 +0300, Michael S. Tsirkin wrote: > > Again, from which originator ? From a given initiator, nothing > bypasses > > anything, so the right thing to do here is a full mb(). However, I > > suspect what you are talking about here is read -responses- not > > bypassing writes

Re: [Qemu-devel] [PATCH] Add a memory barrier to guest memory access function

2012-05-21 Thread Benjamin Herrenschmidt
On Tue, 2012-05-22 at 01:22 +0300, Michael S. Tsirkin wrote: > > Again, from which originator ? From a given initiator, nothing > bypasses > > anything, so the right thing to do here is a full mb(). However, I > > suspect what you are talking about here is read -responses- not > > bypassing writes

Re: [Qemu-devel] [PATCH] Add a memory barrier to guest memory access function

2012-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2012 at 07:58:17AM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2012-05-21 at 15:18 +0300, Michael S. Tsirkin wrote: > > > > mb is more than just "read flush writes" (besides it's not a statement > > > about flushing, it's a statement about ordering. whether it has a > > > flushi

Re: [Qemu-devel] [PATCH] Add a memory barrier to guest memory access function

2012-05-21 Thread Benjamin Herrenschmidt
On Mon, 2012-05-21 at 15:18 +0300, Michael S. Tsirkin wrote: > > mb is more than just "read flush writes" (besides it's not a statement > > about flushing, it's a statement about ordering. whether it has a > > flushing side effect on x86 is a separate issue, it doesn't on power for > > example). >