RE: [RFC PATCH v2 00/10] vfio/mdev: IOMMU aware mediated device

From: Tian, Kevin
Date: Tue Sep 04 2018 - 23:01:55 EST


> From: Lu Baolu [mailto:baolu.lu@xxxxxxxxxxxxxxx]
> Sent: Thursday, August 30, 2018 12:09 PM
>
[...]
>
> In order to distinguish the IOMMU-capable mediated devices from those
> which still need to rely on parent devices, this patch set adds a
> domain type attribute to each mdev.
>
> enum mdev_domain_type {
> DOMAIN_TYPE_NO_IOMMU, /* Don't need any IOMMU support.
> * All isolation and protection
> * are handled by the parent
> * device driver with a device
> * specific mechanism.
> */
> DOMAIN_TYPE_ATTACH_PARENT, /* IOMMU can isolate and
> protect
> * the mdev, and the isolation
> * domain should be attaced with
> * the parent device.
> */
> };
>

ATTACH_PARENT is not like a good counterpart to NO_IOMMU.

what about DOMAIN_TYPE_NO_IOMMU/DOMAIN_TYPE_IOMMU? whether
to attach parent device is just internal logic.

Alternatively DOMAIN_TYPE_SOFTWARE/DOMAIN_TYPE_HARDWARE,
where software means iommu_domain is managed by software while
the other means managed by hardware.

One side note to Alex - with multiple domain extension in IOMMU layer,
this version combines IOMMU-capable usages in VFIO: PASID-based (as
in scalable iov) and RID-based (as the usage of mdev wrapper on any
device). Both cases share the common path - just binding the domain to the
parent device of mdev. IOMMU layer will handle two cases differently later.

Thanks
Kevin