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