All of lore.kernel.org
 help / color / mirror / Atom feed
* RPMSG over VirtIO under KVM
@ 2020-04-16 14:05 Guennadi Liakhovetski
  2020-04-16 17:50 ` Mathieu Poirier
  0 siblings, 1 reply; 3+ messages in thread
From: Guennadi Liakhovetski @ 2020-04-16 14:05 UTC (permalink / raw)
  To: linux-remoteproc

Hi,

It has been proposed to port the VirtIO SOF driver [1], used to 
implement audio support under Linux, running in a KVM guest, to use 
RPMSG to communicate with the SOF vhost driver, running on the Linux 
host. On one hand I see an rpmsg-virtio driver, which should make such 
a port possible, on the other hand I don't see a single VirtIO driver 
in the kernel, using RPMSG for Linux virtualisation.

Hence my questions: is this a good idea? Is there anything in the 
kernel VirtIO RPMSG implementation, that would make this impossible?

Thanks
Guennadi

[1] https://thesofproject.github.io/latest/developer_guides/virtualization/virtualization.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RPMSG over VirtIO under KVM
  2020-04-16 14:05 RPMSG over VirtIO under KVM Guennadi Liakhovetski
@ 2020-04-16 17:50 ` Mathieu Poirier
  2020-04-16 19:15   ` Guennadi Liakhovetski
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Poirier @ 2020-04-16 17:50 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: linux-remoteproc

Good day Guennadi,

On Thu, 16 Apr 2020 at 08:06, Guennadi Liakhovetski
<guennadi.liakhovetski@linux.intel.com> wrote:
>
> Hi,
>
> It has been proposed to port the VirtIO SOF driver [1], used to
> implement audio support under Linux, running in a KVM guest, to use
> RPMSG to communicate with the SOF vhost driver, running on the Linux
> host. On one hand I see an rpmsg-virtio driver, which should make such
> a port possible, on the other hand I don't see a single VirtIO driver
> in the kernel, using RPMSG for Linux virtualisation.

Above you wrote "rpmsg-virtio" driver, which I take to mean the code
found in file virtio_rpmsg_bus.c [1].  The code in [1] centers around
the communication between an application processor and some form of
remote processor (micro controller or dsp).  The "virtio" part of the
name refers to the underlying infrastructure put in place to
communicate with the remote processor, all coming from the virtio
space.  Here instead of using the virtio mechanic to communicate
between a host and a guest, it is used to communicate with a remote
processor.

I came to the same conclusion a while back - as of today no virtio
drivers are using RPMSG to communicate between host and guest.  I
suppose nobody needed it or implemented their own schemes.

[1].  https://elixir.bootlin.com/linux/v5.7-rc1/source/drivers/rpmsg/virtio_rpmsg_bus.c

>
> Hence my questions: is this a good idea? Is there anything in the
> kernel VirtIO RPMSG implementation, that would make this impossible?

I don't see why it wouldn't be a good idea, nor what would technically
prevent such a thing from happening.  Two things work in your favour:
1) the RPMSG foundation has been tailored to be used over different
kinds of hardware and 2) an existing implementation is already using
virtioqueues.

I suggest to start looking at function rpmsg_register_device(), used
by different RPMSG drivers - the magic is really in the RPMSG
operations (struct rpmsg_device_ops) that are used to abstract the HW
implementation.

Regards,
Mathieu

>
> Thanks
> Guennadi
>
> [1] https://thesofproject.github.io/latest/developer_guides/virtualization/virtualization.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RPMSG over VirtIO under KVM
  2020-04-16 17:50 ` Mathieu Poirier
@ 2020-04-16 19:15   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 3+ messages in thread
From: Guennadi Liakhovetski @ 2020-04-16 19:15 UTC (permalink / raw)
  To: Mathieu Poirier; +Cc: linux-remoteproc

Hi Mathieu,

On Thu, Apr 16, 2020 at 11:50:48AM -0600, Mathieu Poirier wrote:
> Good day Guennadi,
> 
> On Thu, 16 Apr 2020 at 08:06, Guennadi Liakhovetski
> <guennadi.liakhovetski@linux.intel.com> wrote:
> >
> > Hi,
> >
> > It has been proposed to port the VirtIO SOF driver [1], used to
> > implement audio support under Linux, running in a KVM guest, to use
> > RPMSG to communicate with the SOF vhost driver, running on the Linux
> > host. On one hand I see an rpmsg-virtio driver, which should make such
> > a port possible, on the other hand I don't see a single VirtIO driver
> > in the kernel, using RPMSG for Linux virtualisation.
> 
> Above you wrote "rpmsg-virtio" driver, which I take to mean the code
> found in file virtio_rpmsg_bus.c [1].

Exactly.

> The code in [1] centers around
> the communication between an application processor and some form of
> remote processor (micro controller or dsp).  The "virtio" part of the
> name refers to the underlying infrastructure put in place to
> communicate with the remote processor, all coming from the virtio
> space.  Here instead of using the virtio mechanic to communicate
> between a host and a guest, it is used to communicate with a remote
> processor.
> 
> I came to the same conclusion a while back - as of today no virtio
> drivers are using RPMSG to communicate between host and guest.  I
> suppose nobody needed it or implemented their own schemes.
> 
> [1].  https://elixir.bootlin.com/linux/v5.7-rc1/source/drivers/rpmsg/virtio_rpmsg_bus.c
> 
> >
> > Hence my questions: is this a good idea? Is there anything in the
> > kernel VirtIO RPMSG implementation, that would make this impossible?
> 
> I don't see why it wouldn't be a good idea, nor what would technically
> prevent such a thing from happening.  Two things work in your favour:
> 1) the RPMSG foundation has been tailored to be used over different
> kinds of hardware and 2) an existing implementation is already using
> virtioqueues.
> 
> I suggest to start looking at function rpmsg_register_device(), used
> by different RPMSG drivers - the magic is really in the RPMSG
> operations (struct rpmsg_device_ops) that are used to abstract the HW
> implementation.

Exactly, just what I was thinking too. And I also think it can well be 
possible to reuse the code in virtio_rpmsg_bus.c, possibly with some 
limited extensions and modifications. I'll get it rolling then.

Thanks
Guennadi

> Regards,
> Mathieu
> 
> > [1] https://thesofproject.github.io/latest/developer_guides/virtualization/virtualization.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-16 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-16 14:05 RPMSG over VirtIO under KVM Guennadi Liakhovetski
2020-04-16 17:50 ` Mathieu Poirier
2020-04-16 19:15   ` Guennadi Liakhovetski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.