Re: [Alacrityvm-devel] [PATCH v3 3/6] vbus: add a "vbus-proxy" bus model for vbus_driver objects

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ira W. Snyder
Date: Tuesday, August 18, 2009 - 1:59 pm

On Tue, Aug 18, 2009 at 09:52:48PM +0300, Avi Kivity wrote:

Ok.

On a non shared-memory system (where the guest's RAM is not just a chunk
of userspace RAM in the host system), virtio's management model seems to
fall apart. Feature negotiation doesn't work as one would expect.

This does appear to be solved by vbus, though I haven't written a
vbus-over-PCI implementation, so I cannot be completely sure.

I'm not at all clear on how to get feature negotiation to work on a
system like mine. From my study of lguest and kvm (see below) it looks
like userspace will need to be involved, via a miscdevice.


Ok. I'm using an initramfs already, so adding some more userspace to it
isn't a problem.


Ok. I thought I should at least express my concerns while we're
discussing this, rather than being too late after finding the time to
study the driver.

Off the top of my head, I would think that transporting userspace
addresses in the ring (for copy_(to|from)_user()) vs. physical addresses
(for DMAEngine) might be a problem. Pinning userspace pages into memory
for DMA is a bit of a pain, though it is possible.

There is also the problem of different endianness between host and guest
in virtio-net. The struct virtio_net_hdr (include/linux/virtio_net.h)
defines fields in host byte order. Which totally breaks if the guest has
a different endianness. This is a virtio-net problem though, and is not
transport specific.


Ok. I've never used eventfd before, so that'll take yet more studying.

I've browsed over both the kvm and lguest code, and it looks like they
each re-invent a mechanism for transporting interrupts between the host
and guest, using eventfd. They both do this by implementing a
miscdevice, which is basically their management interface.

See drivers/lguest/lguest_user.c (see write() and LHREQ_EVENTFD) and
kvm-kmod-devel-88/x86/kvm_main.c (see kvm_vm_ioctl(), called via
kvm_dev_ioctl()) for how they hook up eventfd's.

I can now imagine how two userspace programs (host and guest) could work
together to implement a management interface, including hotplug of
devices, etc. Of course, this would basically reinvent the vbus
management interface into a specific driver.

I think this is partly what Greg is trying to abstract out into generic
code. I haven't studied the actual data transport mechanisms in vbus,
though I have studied virtio's transport mechanism. I think a generic
management interface for virtio might be a good thing to consider,
because it seems there are at least two implementations already: kvm and
lguest.

Thanks for answering my questions. It helps to talk with someone more
familiar with the issues than I am.

Ira
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v3 0/6] AlacrityVM guest drivers, Gregory Haskins, (Fri Aug 14, 8:42 am)
[PATCH v3 1/6] shm-signal: shared-memory signals, Gregory Haskins, (Fri Aug 14, 8:42 am)
[PATCH v3 4/6] vbus-proxy: add a pci-to-vbus bridge, Gregory Haskins, (Fri Aug 14, 8:43 am)
[PATCH v3 5/6] ioq: add driver-side vbus helpers, Gregory Haskins, (Fri Aug 14, 8:43 am)
[PATCH v3 6/6] net: Add vbus_enet driver, Gregory Haskins, (Fri Aug 14, 8:43 am)
Re: [Alacrityvm-devel] [PATCH v3 3/6] vbus: add a "vbus-pr ..., Ira W. Snyder, (Tue Aug 18, 1:59 pm)
configfs/sysfs, Avi Kivity, (Wed Aug 19, 1:12 pm)
Re: configfs/sysfs, Ingo Molnar, (Wed Aug 19, 1:48 pm)
Re: configfs/sysfs, Avi Kivity, (Wed Aug 19, 1:53 pm)
Re: configfs/sysfs, Nicholas A. Bellinger, (Wed Aug 19, 2:19 pm)
Re: configfs/sysfs, Gregory Haskins, (Wed Aug 19, 3:15 pm)
Re: configfs/sysfs, Joel Becker, (Wed Aug 19, 3:16 pm)
Re: [Alacrityvm-devel] configfs/sysfs, Alex Tsariounov, (Wed Aug 19, 4:48 pm)
Re: configfs/sysfs, Nicholas A. Bellinger, (Wed Aug 19, 4:54 pm)
Re: configfs/sysfs, Avi Kivity, (Wed Aug 19, 11:09 pm)
Re: configfs/sysfs, Joel Becker, (Thu Aug 20, 3:48 pm)
Re: configfs/sysfs, Avi Kivity, (Thu Aug 20, 9:14 pm)