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

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-comment message

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


Subject: RE: [virtio-comment] Is there a protocol for interacting with a Linux Host where another Linux guest is the virtio guest?


Hi,

Thank you very much for the content below.  Methinks you have addressed my question.  The PDF, in particular, seems to speak to my questions.

JP

-----Original Message-----
From: Stefan Hajnoczi <stefanha@redhat.com> 
Sent: Saturday, April 2, 2022 12:43 PM
To: Pincus, Josh <Josh.Pincus@windriver.com>
Cc: virtio-comment@lists.oasis-open.org
Subject: Re: [virtio-comment] Is there a protocol for interacting with a Linux Host where another Linux guest is the virtio guest?

On Fri, Apr 01, 2022 at 03:47:31PM +0000, Pincus, Josh wrote:
> HI,
> 
> Thanks in advance for all the newbie help, especially to Stefan who graciously responded yesterday.
> 
> The current spec doesn't say a word about what's presented to the Linux Host (see attached graphic).  It speaks directly to what's presented to the Linux Guest, the user of the virtual device.  By Linux Host, I mean the VM responsible for virtualizing the actual hardware and providing a "virtio device" that receives raw content via the queues from the guest, translates the content into commands that can be understood by the hardware device driver in question, and eventually sends back responses to the guest.  What standard or interface is used by compliant HYPs to configure the Linux Host to fire up a virtual device, negotiate with the guest based on features the HOST supports, respond to register reads/writes performed by the guest, and initiate interrupts back to the guest as needed?  
> 
> Is there any kind of standard or documentation that governs how compliant Hypervisors are supposed to present such an interface to the Linux Host?  Are folks using vhost in the Linux Host to provide an interface to the Host's virtio device and then relying on the HYP to interact with that service when the Guest makes register requests?  

That is beyond the scope of the VIRTIO specification because it varies depending on the details of the hypervisor.

You said "the VM responsible for virtualizating the actual hardware".
The VIRTIO device may or may not be in a VM. It could be part of the hypervisor, passed through to hardware, etc.

If you look at QEMU, kvmtool, Firecracker, and other VMMs, they implement VIRTIO devices using internal APIs and there is no standard.

There are some interfaces for specific use cases: vhost, vhost-user, vDPA, VDUSE, etc. They are sometimes called "out-of-process device emulation" interfaces and potentially allow you to implement a VIRTIO device once and use it across multiple hypervisors. Here are slides that cover recent options in the Linux world:
https://vmsplice.net/~stefan/VHPC%202021%20-%20Bring%20your%20own%20virtual%20devices.pdf

It's typical for QEMU KVM guests to have a mix of vhost kernel and QEMU VIRTIO devices (host userspace). That's because certain things are better done in the host kernel and therefore implemented as vhost drivers. Other things don't benefit from being in the kernel and implementing them as part of QEMU (or a vhost-user device) is a natural choice.

To summarize: there is no one-size-fits-all standard but check your specific use case to see if an out-of-process device emulation interface would be a good fit.

Stefan


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