On Thu, 24 Dec 2009 03:06:00 am Michael S. Tsirkin wrote: > On Wed, Dec 23, 2009 at 05:04:19PM +1030, Rusty Russell wrote: > > It's possible, but I don't know of any missing cases. Certainly *lguest* i > > is missing barriers, since it's UP, but the core virtio should have them. > > Something that Paul Brook pointed out, is that > using a 16 bit value in C like we do in guest, e.g. with > ring->avail.idx > might in theory result in two single byte reads. > > If this happens, guest will see a wrong index value.
In the Linux kernel we make atomicity assumptions about fundamental types. (Specifically pointers). QEMU may not want to rely on such assumptions however, and make them explicit. I have sympathy with Paul here. Cheers, Rusty.