OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [virtio-dev] Backend libraries for VirtIO device emulation


On Mon, Mar 09, 2020 at 05:42:39PM +0000, Alex Bennée wrote:
> 
> Srivatsa Vaddagiri <vatsa.ml@gmail.com> writes:
> 
> > On Mon, Mar 9, 2020 at 9:16 PM Stefan Hajnoczi <stefanha@redhat.com> wrote:
> >>
> >> That already exists today.  Pick a vhost-user device implementation from
> >> QEMU, DPDK/SPDK, or rust-vmm and run it with your VMM of choice.
> >>
> >> > backend be emulated purely with some shared memory and some sockets for
> >> > passing messages/kicks from/to the VMM which then deals with the hypervisor
> >> > specifics of the virtio-transport?
> >>
> >> Yes, that is what vhost-user does.
> >
> > Are there vhost-user based backends that emulates block and console devices?
> >
> > From my quick read, vhost-user seems to depend on having backend complete access
> > to front-end's memory. Is that true? We are looking for a backend solution that
> > does not assume access to whole of front-end memory. Only the memory regions
> > hosting IO buffers need to be ideally shared between the two VMs.
> 
> I think it currently is true because generally the pointers passed in
> the virtqueues are directly into the various internal structures of the
> kernel (e.g. pagecache, skb etc.).
> 
> Now for linux the are ways of declaring particular buffers to be in
> specific locations - ostensibly for things like DMA-ability. But AFAICT
> there is no mechanism to communicate the particular locations to be used
> to the VMM and backend daemon.

Yes, the problem is that guest userspace memory buffers could be
anywhere and the virtqueue DMA memory managed by the guest drivers is
also not allocated from a specific memory range.

When the guest cooperates (e.g. DPDK applications that use a fixed
memory range for virtio-net packet buffers), then it's possible to
reduce the shared memory region to not expose all of guest RAM.

> > Also the
> > mechanism of memory sharing and signalling between VMs could be very
> > hypervisor specific.
> > Does vhost-user allow for such hyp-specific memory sharing and
> > signalling interfaces?
> 
> The daemons I've looked at so far are passed a shm fd and a control fd
> from the VMM. From their point of view it's just posix shared memory and
> a event queue via a socket. Setting that up is the VMMs problem.

Yes, although I don't think there is any assumption that the fd is POSIX
shared memory.  The fd just needs to support mmap(2).

Stefan

Attachment: signature.asc
Description: PGP signature



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]