From nobody Sun Feb 8 16:12:29 2026
Delivered-To: importer@patchew.org
Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28
as permitted sender) client-ip=209.132.183.28;
envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com;
Authentication-Results: mx.zoho.com;
spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as
permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com;
Return-Path:
@@ -75,6 +75,7 @@
+ A PCI device capable of creating mediated devices will include a nes=
ted
+ capability
+ For a more info about mediated devices, refer to the
+ paragraph below.
+
+ Mediated devices (Since 3.3.0) are soft=
ware
+ devices defining resource allocation on the backing physical device =
which
+ in turn allows the parent physical device's resources to be divided =
into
+ several mediated devices, thus sharing the physical device's perform=
ance
+ among multiple guests. Unlike SR-IOV however, where a PCIe device ap=
pears
+ as multiple separate PCIe devices on the host's PCI bus, mediated de=
vices
+ only appear on the mdev virtual bus. Therefore, no detach/reattach
+ procedure from/to the host driver procedure is involved even though
+ mediated devices are used in a direct device assignment manner.
+ The support of mediated device's framework in libvirt's node device =
driver
+ covers the following features:
+
+ Because mediated devices are instantiated from vendor specific templ=
ates,
+ simply called 'types', information describing these types is contain=
ed
+ within the parent device's capabilities
+ (see the example in PCI host devices).
+ To manually instantiate a mediated device, use one of the following =
as a
+ reference:
+
+ Manual removal of a mediated device is then performed as follows:
+ storage (Since 1.0.4),
scsi_generic (Since 1.0.7),
drm (Since 3.1.0), and
+ mdev (Since 3.3.0).
This element can be nested in which case it further specifies a
device's capability. Refer to specific device types to see more =
values
for the type attribute which are exclusive.
@@ -185,5 +186,166 @@
...
<device>
=20
+ MDEV capability
+ mdev_types which enumerates all supported md=
ev
+ types on the physical device, along with the type attributes availab=
le
+ through sysfs:
+
+
+
+ typeid which h=
olds
+ an official vendor-supplied identifier for the type.
+ Since 3.3.0
+ namename element holds a vendor-supplied code name for
+ the given mediated device type. This is an optional element.
+ Since 3.3.0
+ deviceAPIavailableInstances
+<device>
+...
+ <driver>
+ <name>nvidia</name>
+ </driver>
+ <capability type=3D'pci'>
+...
+ <capability type=3D'mdev_types'>
+ <type id=3D'nvidia-11'>
+ <name>GRID M60-0B</name>
+ <deviceAPI>vfio-pci</deviceAPI>
+ <availableInstances>16</availableInstances>
+ </type>
+ <!-- Here would come the rest of the available mdev types -->
+ </capability>
+...
+ </capability>
+</device>
+
+ Mediated devices (MDEVs)
+
+
+ The following sub-elements and attributes are exposed within the
+ capability element:
+
+
+
+ typeid which h=
olds
+ an official vendor-supplied identifier for the type.
+ Since 3.3.0
+ iommuGroupnumber which=
holds
+ the IOMMU group number the mediated device belongs to.
+ Since 3.3.0
+ Example of a mediated device
+
+<device>
+ <name>mdev_4b20d080_1b54_4048_85b3_a6a62d165c01</name>
+ <path>/sys/devices/pci0000:00/0000:00:02.0/4b20d080-1b54-4048-85b3=
-a6a62d165c01</path>
+ <parent>pci_0000_06_00_0</parent>
+ <driver>
+ <name>vfio_mdev</name>
+ </driver>
+ <capability type=3D'mdev'>
+ <type id=3D'nvidia-11'/>
+ <iommuGroup number=3D'12'/>
+ <capability/>
+<device/>
+
+
+
+
+
+
+ To see the supported mediated device types on a specific physical de=
vice
+ use the following:
+
+$ ls /sys/class/mdev_bus/<device>/mdev_supported_types
+
+
+$ uuidgen > /sys/class/mdev_bus/<device>/mdev_supported_types/<=
;type>/create
+...
+$ echo <UUID> > /sys/class/mdev_bus/<device>/mdev_supported=
_types/<type>/create
+
+
+$ echo 1 > /sys/bus/mdev/devices/<uuid>/remove
+