qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] virtio: Make memory barriers be memory barriers


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH] virtio: Make memory barriers be memory barriers
Date: Sun, 4 Sep 2011 11:47:50 +0300
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Sep 03, 2011 at 06:19:23PM +0200, Paolo Bonzini wrote:
> On 09/02/2011 05:45 PM, Michael S. Tsirkin wrote:
> >Well, can you describe an issue in virtio that lfence/sfence help solve
> >in terms of a memory model please?
> >Pls note that guest uses smp_ variants for barriers.
> 
>     /* Make sure buffer is written before we update index. */
>     wmb();
> 
> Without it, a guest could see a partially updated buffer, because
> the buffer and index writes are unlocked stores to different
> locations.

Sorry, I still don't understand. Yes, they are unlocked stores to different
locations. How does it follow that a guest could see a partially updated
buffer? Just to make sure - we are talking about x86 here, not ppc,
right?

> Even if the guest uses barriers, with ioeventfd it will only order
> the CPU that is running the guest, not the one that is running the
> iothread.  In fact I'm surprised that it works at all under x86 with
> ioeventfd.
> 
> Paolo

I can try to explain if I understand the problem you see.

-- 
MST



reply via email to

[Prev in Thread] Current Thread [Next in Thread]