From 9c0981ea2e42721f2b35bf680536c12b010d0912 Mon Sep 17 00:00:00 2001 From: Shalini Chellathurai Saroja Date: Mon, 7 May 2018 16:41:17 +0200 Subject: [PATCH] docs: documentation for vfio-ccw passthrough Signed-off-by: Shalini Chellathurai Saroja Reviewed-by: Bjoern Walk Reviewed-by: Boris Fiuczynski Reviewed-by: John Ferlan --- docs/drvnodedev.html.in | 21 ++++++++++++++++++++- docs/formatdomain.html.in | 20 +++++++++++++++----- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/docs/drvnodedev.html.in b/docs/drvnodedev.html.in index 885904d67d..71a8a57b0c 100644 --- a/docs/drvnodedev.html.in +++ b/docs/drvnodedev.html.in @@ -334,9 +334,28 @@
 $ ls /sys/class/mdev_bus/<device>/mdev_supported_types
+

+ Before creating a mediated device, unbind the device from the respective + device driver, eg. subchannel I/O driver for a CCW device. Then bind the + device to the respective VFIO driver. For a CCW device, also unbind the + corresponding subchannel of the CCW device from the subchannel I/O driver + and then bind the subchannel (instead of the CCW device) to the vfio_ccw + driver. The below example shows the unbinding and binding steps for a CCW + device. +

+ +
+device="0.0.1234"
+subchannel="0.0.0123"
+echo $device > /sys/bus/ccw/devices/$device/driver/unbind
+echo $subchannel > /sys/bus/css/devices/$subchannel/driver/unbind
+echo $subchannel > /sys/bus/css/drivers/vfio_ccw/bind
+    
+

To manually instantiate a mediated device, use one of the following as a - reference: + reference. For a CCW device, use the subchannel ID instead of the device + ID.

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 80172c18d0..63665906ab 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -4350,6 +4350,12 @@
       <address uuid='c2177883-f1bb-47f0-914d-32a22e3a8804'/>
     </source>
     </hostdev>
+    <hostdev mode='subsystem' type='mdev' model='vfio-ccw'>
+    <source>
+      <address uuid='9063cba3-ecef-47b6-abcf-3fef4fdcad85'/>
+    </source>
+    <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+    </hostdev>
   </devices>
   ...
@@ -4401,10 +4407,13 @@
For mediated devices (Since 3.2.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 model='vfio-pci' is supported. - There are also some implications on the usage of guest's address type - depending on the model attribute, see the - address element below.
+ guest. Currently, model='vfio-pci' and + model='vfio-ccw' (Since 4.4.0) + is supported. Refer MDEV to create + a mediated device on the host. There are also some implications on the + usage of guest's address type depending on the model + attribute, see the address element below. +

Note: The managed attribute is only used with @@ -4536,7 +4545,8 @@ devices defining an allocation of resources on the physical parent device, the address type used must conform to the model attribute of element hostdev, e.g. any address type other than PCI for - vfio-pci device API will result in an error. + vfio-pci device API or any address type other than CCW for + vfio-ccw device API will result in an error. See above for more details on the address element.

driver