Re: [libvirt] docs: Document the new hostdev and address type 'mdev'

2017-02-27 Thread Alex Williamson
On Mon, 27 Feb 2017 11:03:42 +0100
Erik Skultety  wrote:

> On Mon, Feb 27, 2017 at 09:33:51AM +0100, Martin Polednik wrote:
> > On 20/02/17 15:28 +0100, Erik Skultety wrote:  
> > > Signed-off-by: Erik Skultety 
> > > ---
> > > docs/formatdomain.html.in | 48 
> > > +++
> > > 1 file changed, 44 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> > > index b69bd4c..13cb767 100644
> > > --- a/docs/formatdomain.html.in
> > > +++ b/docs/formatdomain.html.in
> > > @@ -3277,8 +3277,20 @@
> > > attributes: iobase and irq.
> > > Since 1.2.1
> > >   
> > > +  mdev
> > > +  Mediated devices' addresses have so far only one mandatory 
> > > attribute
> > > +uuid (since 3.1.0) which
> > > +uniquely identifies a mediated device under the syfs file system.
> > > +  
> > > 
> > > 
> > > +
> > > +Note: Due to nature of mediated devices, being only software 
> > > devices
> > > +defining an allocation of resources on the physical parent 
> > > device, the
> > > +address type mdev is supposed to be used to 
> > > identify a
> > > +device on the host only, rather than identifying it in the guest.
> > > +
> > > +
> > > Controllers
> > > 
> > > 
> > > @@ -3774,6 +3786,19 @@
> > >   /devices
> > >   ...
> > > 
> > > +or:
> > > +
> > > +
> > > +  ...
> > > +  devices
> > > +hostdev mode='subsystem' type='mdev' model='vfio-pci'
> > > +source
> > > +  address type='mdev' 
> > > uuid='c2177883-f1bb-47f0-914d-32a22e3a8804'
> > > +/source
> > > +/hostdev
> > > +  /devices
> > > +  ...  
> > 
> > Can't really test it yet, but from the docs/code seems to be OK for
> > oVirt.
> >   
> 
> Actually you can, with kernel 4.10, I don't know how the distro-packaged
> kernels are configured, so my honest guess just would be to try modprobe mtty
> and see what happens. Anyway, you can build your own kernel and just make sure
> the vfio mediated devices framework is either included or modularized and the
> CONFIG_SAMPLE_VFIO_MDEV_MTTY sample driver is checked and you're good to go.

Distro kernels aren't likely to include sample drivers, but KVMGT (ie.
Intel vGPUs) also went in for v4.10 and makes use of the vfio-mdev
framework as well.  These should be supported on Broadwell and newer
systems.  There's work yet to do for stability and robustness of this
particular mdev driver, but the sysfs interface mostly behaves as
intended and it can be expected to improve significantly though v4.11
kernels and v4.10 stable backports.  Thanks,

Alex

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] docs: Document the new hostdev and address type 'mdev'

2017-02-27 Thread Erik Skultety
On Mon, Feb 27, 2017 at 09:33:51AM +0100, Martin Polednik wrote:
> On 20/02/17 15:28 +0100, Erik Skultety wrote:
> > Signed-off-by: Erik Skultety 
> > ---
> > docs/formatdomain.html.in | 48 
> > +++
> > 1 file changed, 44 insertions(+), 4 deletions(-)
> > 
> > diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> > index b69bd4c..13cb767 100644
> > --- a/docs/formatdomain.html.in
> > +++ b/docs/formatdomain.html.in
> > @@ -3277,8 +3277,20 @@
> > attributes: iobase and irq.
> > Since 1.2.1
> >   
> > +  mdev
> > +  Mediated devices' addresses have so far only one mandatory 
> > attribute
> > +uuid (since 3.1.0) which
> > +uniquely identifies a mediated device under the syfs file system.
> > +  
> > 
> > 
> > +
> > +Note: Due to nature of mediated devices, being only software 
> > devices
> > +defining an allocation of resources on the physical parent device, 
> > the
> > +address type mdev is supposed to be used to identify a
> > +device on the host only, rather than identifying it in the guest.
> > +
> > +
> > Controllers
> > 
> > 
> > @@ -3774,6 +3786,19 @@
> >   /devices
> >   ...
> > 
> > +or:
> > +
> > +
> > +  ...
> > +  devices
> > +hostdev mode='subsystem' type='mdev' model='vfio-pci'
> > +source
> > +  address type='mdev' 
> > uuid='c2177883-f1bb-47f0-914d-32a22e3a8804'
> > +/source
> > +/hostdev
> > +  /devices
> > +  ...
> 
> Can't really test it yet, but from the docs/code seems to be OK for
> oVirt.
> 

Actually you can, with kernel 4.10, I don't know how the distro-packaged
kernels are configured, so my honest guess just would be to try modprobe mtty
and see what happens. Anyway, you can build your own kernel and just make sure
the vfio mediated devices framework is either included or modularized and the
CONFIG_SAMPLE_VFIO_MDEV_MTTY sample driver is checked and you're good to go.

Erik

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] docs: Document the new hostdev and address type 'mdev'

2017-02-27 Thread Martin Polednik

On 20/02/17 15:28 +0100, Erik Skultety wrote:

Signed-off-by: Erik Skultety 
---
docs/formatdomain.html.in | 48 +++
1 file changed, 44 insertions(+), 4 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index b69bd4c..13cb767 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3277,8 +3277,20 @@
attributes: iobase and irq.
Since 1.2.1
  
+  mdev
+  Mediated devices' addresses have so far only one mandatory attribute
+uuid (since 3.1.0) which
+uniquely identifies a mediated device under the syfs file system.
+  


+
+Note: Due to nature of mediated devices, being only software devices
+defining an allocation of resources on the physical parent device, the
+address type mdev is supposed to be used to identify a
+device on the host only, rather than identifying it in the guest.
+
+
Controllers


@@ -3774,6 +3786,19 @@
  /devices
  ...

+or:
+
+
+  ...
+  devices
+hostdev mode='subsystem' type='mdev' model='vfio-pci'
+source
+  address type='mdev' uuid='c2177883-f1bb-47f0-914d-32a22e3a8804'
+/source
+/hostdev
+  /devices
+  ...


Can't really test it yet, but from the docs/code seems to be OK for
oVirt.


+

  hostdev
  The hostdev element is the main container for describing
@@ -3818,12 +3843,23 @@
type passes all LUNs presented by a single HBA to
the guest.
  
+  mdev
+  For mediated devices (Since 3.1.0)
+  the model attribute specifies the device API which
+  determines how the host's vfio driver will expose the device to the
+  guest. Currently, only vfio-pci model is supported.
+  The model also has implications on the guest's address type, i.e.
+  for vfio-pci device API any address type other than PCI
+  will result in an error.
+  


-  Note: The managed attribute is only used with PCI 
devices
-  and is ignored by all the other device types, thus setting
-  managed explicitly with other than PCI device has the 
same
-  effect as omitting it.
+  Note: The managed attribute is only used with PCI and is
+  ignored by all the other device types, thus setting
+  managed explicitly with other than a PCI device has the
+  same effect as omitting it. Similarly, model attribute 
is
+  only supported by mediated devices and ignored by all other device
+  types.

  
  source
@@ -3888,6 +3924,10 @@
is the vhost_scsi wwpn (16 hexadecimal digits with a prefix of
"naa.") established in the host configfs.
  
+  mdev
+  Mediated devices (Since 3.1.0) are
+  described by the address element.
+  

  
  vendor, product
--
2.10.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list