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: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] virtio: Make memory barriers be memory barriers
Date: Sat, 03 Sep 2011 18:19:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

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.

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



reply via email to

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