Thu, 03 Mar 2005

So I have been speaking with the Xen people, and I have failed to convert them to my way of doing inter-partition I/O. I believe my method is simpler and cleaner, but theirs is more mature (I have a prototype). At the core, they explicitly map another domain's memory into their own for bulk data transport. This leads to lifetime and accounting difficulties with malicious domains, but also complexity from the Operating System's (ie driver's) point of view. In my model, the domain registers a scatter-gather list which returns an ID, and another domain then asks the hypervisor to transfer data in or out of that scatter-gather list. The registration step is amortized quite well by using a recycled pool of skbs (for my network driver example), so it's still about one hypercall per transfer; my preliminary results reflected this performance parity. It can also be used N-way triggering. However, the real benefit is the similarity to normal DMA, which makes drivers which look like "normal" drivers.

My other difference was that my "event channels" were bound directly to a physical address, rather than explicitly to an identifier. The other end said "fire off anyone bound to this address". This simplifies binding while still enforcing security, which is implied by sharing memory. The implementation was also a little more flexible than the event channel model used in Xen: when creating an event channel the OS passed a pointer to a domain-private atomic int. On every trigger, that was decremented, and if zero, caused a virtual interrupt. In my example network driver, the driver bound an event channel to the address of every scatter gather id, with the each decrement pointer pointing into its internal data structures, and all triggering the same interrupt. When that interrupt occurred, it would scan those structures for a value <= 0. Xen uses a simple "triggered" bit array in a fixed location, which I like because if its simplicity.

So I'm now implementing "bind to address" event channels in Xen, to see how useful they are. I can then add one feature at a time to see what effect it has on the OS drivers, which is the interface I care about.

[/tech] permanent link