tmp_suning_uos_patched/drivers/vfio
Lu Baolu 8ac13175cb vfio/mdev: Add iommu related member in mdev_device
A parent device might create different types of mediated
devices. For example, a mediated device could be created
by the parent device with full isolation and protection
provided by the IOMMU. One usage case could be found on
Intel platforms where a mediated device is an assignable
subset of a PCI, the DMA requests on behalf of it are all
tagged with a PASID. Since IOMMU supports PASID-granular
translations (scalable mode in VT-d 3.0), this mediated
device could be individually protected and isolated by an
IOMMU.

This patch adds a new member in the struct mdev_device to
indicate that the mediated device represented by mdev could
be isolated and protected by attaching a domain to a device
represented by mdev->iommu_device. It also adds a helper to
add or set the iommu device.

* mdev_device->iommu_device
  - This, if set, indicates that the mediated device could
    be fully isolated and protected by IOMMU via attaching
    an iommu domain to this device. If empty, it indicates
    using vendor defined isolation, hence bypass IOMMU.

* mdev_set/get_iommu_device(dev, iommu_device)
  - Set or get the iommu device which represents this mdev
    in IOMMU's device scope. Drivers don't need to set the
    iommu device if it uses vendor defined isolation.

Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Cc: Liu Yi L <yi.l.liu@intel.com>
Suggested-by: Kevin Tian <kevin.tian@intel.com>
Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2019-04-12 13:00:37 +02:00
..
mdev vfio/mdev: Add iommu related member in mdev_device 2019-04-12 13:00:37 +02:00
pci vfio/pci: use correct format characters 2019-04-03 12:36:20 -06:00
platform vfio: platform: reset: fix up include directives to remove ccflags-y 2019-02-05 13:29:30 -07:00
Kconfig drivers/vfio: Allow type-1 IOMMU instantiation with all ARM/ARM64 IOMMUs 2018-09-25 13:01:28 -06:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vfio_iommu_spapr_tce.c vfio/spapr_tce: Make symbol 'tce_iommu_driver_ops' static 2019-04-03 12:42:02 -06:00
vfio_iommu_type1.c vfio/type1: Limit DMA mappings per container 2019-04-03 12:43:05 -06:00
vfio_spapr_eeh.c powerpc/eeh: Improve recovery of passed-through devices 2019-02-05 11:55:44 +11:00
vfio.c vfio: expand minor range when registering chrdev region 2019-02-12 13:20:56 -07:00
virqfd.c fs: add new vfs_poll and file_can_poll helpers 2018-05-26 09:16:44 +02:00