On 07/04/2011 01:49 PM, Michael S. Tsirkin wrote:
On Mon, Jul 04, 2011 at 01:27:45PM +0300, Avi Kivity wrote: > I'd like to be able to forward an entire PCI BAR > over a pipe. That means sending the address/data/length tuple, and > both read and write support. > > >> Is the write guaranteed atomic? We probably need serialization here. > > > >afaik vfs_write is just a wrapper to the write() function of the > >underlying fs so it should be atomic, no? > > write() isn't atomic in general. It is for pipes under certain > circumstances, but there is no guarantee that the circumstances > apply, or that the fd is in fact a pipe. So the above makes it tricky to pass structured data which is> 1 byte in size over a pipe. We could build an in-kernel API (not sure how useful it would be for userspace) to do an atomic write or fail (instead of a partial write), but we'll still need to handle failures.
We don't need atomicity after a failure, just under normal operation, and that can be provided by a mutex.
It's not trivial since a single fd might be associated with several region. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html