[PATCH v5 4/8] iommu/vt-d: Aux-domain specific domain attach/detach

2019-01-09 Thread Lu Baolu
When multiple domains per device has been enabled by the device driver, the device will tag the default PASID for the domain to all DMA traffics out of the subset of this device; and the IOMMU should translate the DMA requests in PASID granularity. This adds the

[PATCH v5 5/8] iommu/vt-d: Return ID associated with an auxiliary domain

2019-01-09 Thread Lu Baolu
This adds support to return the default pasid associated with an auxiliary domain. The PCI device which is bound with this domain should use this value as the pasid for all DMA requests of the subset of device which is isolated and protected with this domain. Cc: Ashok Raj Cc: Jacob Pan Cc:

[PATCH v5 7/8] vfio/type1: Add domain at(de)taching group helpers

2019-01-09 Thread Lu Baolu
This adds helpers to attach or detach a domain to a group. This will replace iommu_attach_group() which only works for non-mdev devices. If a domain is attaching to a group which includes the mediated devices, it should attach to the iommu device (a pci device which represents the mdev in iommu

[PATCH v5 8/8] vfio/type1: Handle different mdev isolation type

2019-01-09 Thread Lu Baolu
This adds the support to determine the isolation type of a mediated device group by checking whether it has an iommu device. If an iommu device exists, an iommu domain will be allocated and then attached to the iommu device. Otherwise, keep the same behavior as it is. Cc: Ashok Raj Cc: Jacob Pan

[PATCH v5 2/8] iommu/vt-d: Add per-device IOMMU feature ops entries

2019-01-09 Thread Lu Baolu
This adds the iommu ops entries for aux-domain per-device feature query and enable/disable. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Sanjay Kumar Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu --- drivers/iommu/intel-iommu.c | 86 +

[PATCH v5 3/8] iommu/vt-d: Move common code out of iommu_attch_device()

2019-01-09 Thread Lu Baolu
This part of code could be used by both normal and aux domain specific attach entries. Hence move them into a common function to avoid duplication. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Lu Baolu --- drivers/iommu/intel-iommu.c | 60 ++--- 1

[PATCH v5 6/8] vfio/mdev: Add iommu related member in mdev_device

2019-01-09 Thread Lu Baolu
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

[PATCH v5 0/8] vfio/mdev: IOMMU aware mediated device

2019-01-09 Thread Lu Baolu
Hi, The Mediate Device is a framework for fine-grained physical device sharing across the isolated domains. Currently the mdev framework is designed to be independent of the platform IOMMU support. As the result, the DMA isolation relies on the mdev parent device in a vendor specific way. There

[PATCH v5 1/8] iommu: Add APIs for multiple domains per device

2019-01-09 Thread Lu Baolu
Sharing a physical PCI device in a finer-granularity way is becoming a consensus in the industry. IOMMU vendors are also engaging efforts to support such sharing as well as possible. Among the efforts, the capability of support finer-granularity DMA isolation is a common requirement due to the

Re: [PATCH] arm64: dts: stratix10: Add Stratix10 SMMU support

2019-01-09 Thread Dinh Nguyen
On 1/4/19 1:23 PM, thor.tha...@linux.intel.com wrote: > From: Thor Thayer > > Now there are device tree clocks for the ARM64 SMMU, > add SMMU support to the Stratix10 Device Tree which > includes adding the SMMU node and adding IOMMU stream > ids to the SMMU peripherals. > > Signed-off-by:

Re: use generic DMA mapping code in powerpc V4

2019-01-09 Thread Christian Zigotzky
Next step: a64e18ba191ba9102fb174f27d707485ffd9389c (powerpc/dma: remove dma_nommu_get_required_mask) git clone git://git.infradead.org/users/hch/misc.git -b powerpc-dma.6 a git checkout a64e18ba191ba9102fb174f27d707485ffd9389c Link to the Git: