All of lore.kernel.org
 help / color / mirror / Atom feed
* Instantiate mdev device in host?
@ 2021-03-17 19:13 Derrick, Jonathan
  2021-03-17 21:58 ` Alex Williamson
  0 siblings, 1 reply; 2+ messages in thread
From: Derrick, Jonathan @ 2021-03-17 19:13 UTC (permalink / raw)
  To: kwankhede, alex.williamson; +Cc: kvm

Hi Kirti, Alex,

I've written a host mdev driver for a pcie instrument that divides its
resources to a guest driver and manages per-instance interfacing.

We have a use case where we might want to drive the instrument directly
from the host in the same application that the mdev guest would use.

Is there a way to instantiate the emulated pci device in the host?
Or a recommended way to interface an existing pci (guest) driver to the
vfio-mdev device?

Best,
Jon

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

* Re: Instantiate mdev device in host?
  2021-03-17 19:13 Instantiate mdev device in host? Derrick, Jonathan
@ 2021-03-17 21:58 ` Alex Williamson
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Williamson @ 2021-03-17 21:58 UTC (permalink / raw)
  To: Derrick, Jonathan; +Cc: kwankhede, kvm

On Wed, 17 Mar 2021 19:13:30 +0000
"Derrick, Jonathan" <jonathan.derrick@intel.com> wrote:

> Hi Kirti, Alex,
> 
> I've written a host mdev driver for a pcie instrument that divides its
> resources to a guest driver and manages per-instance interfacing.
> 
> We have a use case where we might want to drive the instrument directly
> from the host in the same application that the mdev guest would use.
> 
> Is there a way to instantiate the emulated pci device in the host?
> Or a recommended way to interface an existing pci (guest) driver to the
> vfio-mdev device?

No, mdev is exposing the device through the vfio API, you either need a
driver for that API (ex. DPDK) or you need something to compose that
API into a virtual PCI device for a guest (QEMU).  mdev devices cannot
make a new struct pci_dev in the host for a host drivers to bind to,
you'd want something more like direct SR-IOV for that.  Potentially if
you're willing to run the application in a container, a Kata container
could transparently include that re-composition in QEMU.  This seems
like the same problem your SIOV friends @Intel are facing, where
creating separate userspace interfaces, one via mdev and one via device
specific mechanism has been discouraged.  You might look at how idxd
development has been working to address this criticism.  Thanks,

Alex


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

end of thread, other threads:[~2021-03-17 22:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17 19:13 Instantiate mdev device in host? Derrick, Jonathan
2021-03-17 21:58 ` Alex Williamson

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.