mbox series

[v3,00/13] iommu: Add PASID support to Arm SMMUv3

Message ID 20191209180514.272727-1-jean-philippe@linaro.org (mailing list archive)
Headers show
Series iommu: Add PASID support to Arm SMMUv3 | expand

Message

Jean-Philippe Brucker Dec. 9, 2019, 6:05 p.m. UTC
Add support for Substream ID and PASIDs to the SMMUv3 driver.
Changes since v2 [1]:

* Split preparatory work into patches 5, 6, 8 and 9.

* Added patch 1. Not strictly relevant, but since we're moving the DMA
  allocations and adding a new one, we might as well clean the flags
  first.

* Fixed a double free reported by Jonathan, and other small
  issues.

* Added patch 12. Upstream commit c6e9aefbf9db ("PCI/ATS: Remove unused
  PRI and PASID stubs") removed the unused PASID stubs. Since the SMMU
  driver can be built without PCI, the stubs are now needed.

[1] https://lore.kernel.org/linux-iommu/20191108152508.4039168-1-jean-philippe@linaro.org/

Jean-Philippe Brucker (13):
  iommu/arm-smmu-v3: Drop __GFP_ZERO flag from DMA allocation
  dt-bindings: document PASID property for IOMMU masters
  iommu/arm-smmu-v3: Support platform SSID
  ACPI/IORT: Support PASID for platform devices
  iommu/arm-smmu-v3: Prepare arm_smmu_s1_cfg for SSID support
  iommu/arm-smmu-v3: Add context descriptor tables allocators
  iommu/arm-smmu-v3: Add support for Substream IDs
  iommu/arm-smmu-v3: Propate ssid_bits
  iommu/arm-smmu-v3: Handle failure of arm_smmu_write_ctx_desc()
  iommu/arm-smmu-v3: Add second level of context descriptor table
  iommu/arm-smmu-v3: Improve add_device() error handling
  PCI/ATS: Add PASID stubs
  iommu/arm-smmu-v3: Add support for PCI PASID

 .../devicetree/bindings/iommu/iommu.txt       |   6 +
 drivers/acpi/arm64/iort.c                     |  18 +
 drivers/iommu/arm-smmu-v3.c                   | 462 +++++++++++++++---
 drivers/iommu/of_iommu.c                      |   6 +-
 include/linux/iommu.h                         |   2 +
 include/linux/pci-ats.h                       |   3 +
 6 files changed, 437 insertions(+), 60 deletions(-)

Comments

zhangfei.gao@foxmail.com Dec. 10, 2019, 5:52 a.m. UTC | #1
On 2019/12/10 上午2:05, Jean-Philippe Brucker wrote:
> Add support for Substream ID and PASIDs to the SMMUv3 driver.
> Changes since v2 [1]:
>
> * Split preparatory work into patches 5, 6, 8 and 9.
>
> * Added patch 1. Not strictly relevant, but since we're moving the DMA
>    allocations and adding a new one, we might as well clean the flags
>    first.
>
> * Fixed a double free reported by Jonathan, and other small
>    issues.
>
> * Added patch 12. Upstream commit c6e9aefbf9db ("PCI/ATS: Remove unused
>    PRI and PASID stubs") removed the unused PASID stubs. Since the SMMU
>    driver can be built without PCI, the stubs are now needed.
>
> [1] https://lore.kernel.org/linux-iommu/20191108152508.4039168-1-jean-philippe@linaro.org/
>
> Jean-Philippe Brucker (13):
>    iommu/arm-smmu-v3: Drop __GFP_ZERO flag from DMA allocation
>    dt-bindings: document PASID property for IOMMU masters
>    iommu/arm-smmu-v3: Support platform SSID
>    ACPI/IORT: Support PASID for platform devices
>    iommu/arm-smmu-v3: Prepare arm_smmu_s1_cfg for SSID support
>    iommu/arm-smmu-v3: Add context descriptor tables allocators
>    iommu/arm-smmu-v3: Add support for Substream IDs
>    iommu/arm-smmu-v3: Propate ssid_bits
>    iommu/arm-smmu-v3: Handle failure of arm_smmu_write_ctx_desc()
>    iommu/arm-smmu-v3: Add second level of context descriptor table
>    iommu/arm-smmu-v3: Improve add_device() error handling
>    PCI/ATS: Add PASID stubs
>    iommu/arm-smmu-v3: Add support for PCI PASID
>

Thanks Jean for enabling the sva feature.

The series tested well on Hisilicon platform KunPeng920
Tested-by: Zhangfei Gao <zhangfei.gao@linaro.org>

Thanks
Jonathan Cameron Dec. 13, 2019, 5:10 p.m. UTC | #2
On Mon, 9 Dec 2019 19:05:01 +0100
Jean-Philippe Brucker <jean-philippe@linaro.org> wrote:

> Add support for Substream ID and PASIDs to the SMMUv3 driver.
> Changes since v2 [1]:
> 
> * Split preparatory work into patches 5, 6, 8 and 9.
> 
> * Added patch 1. Not strictly relevant, but since we're moving the DMA
>   allocations and adding a new one, we might as well clean the flags
>   first.
> 
> * Fixed a double free reported by Jonathan, and other small
>   issues.
> 
> * Added patch 12. Upstream commit c6e9aefbf9db ("PCI/ATS: Remove unused
>   PRI and PASID stubs") removed the unused PASID stubs. Since the SMMU
>   driver can be built without PCI, the stubs are now needed.
> 
> [1] https://lore.kernel.org/linux-iommu/20191108152508.4039168-1-jean-philippe@linaro.org/

Hi Jean-Philippe,

Series looks great to me.  FWIW

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
for the patches I didn't comment on in this version as I couldn't find anything
to comment about ;)

Thanks

Jonathan

> 
> Jean-Philippe Brucker (13):
>   iommu/arm-smmu-v3: Drop __GFP_ZERO flag from DMA allocation
>   dt-bindings: document PASID property for IOMMU masters
>   iommu/arm-smmu-v3: Support platform SSID
>   ACPI/IORT: Support PASID for platform devices
>   iommu/arm-smmu-v3: Prepare arm_smmu_s1_cfg for SSID support
>   iommu/arm-smmu-v3: Add context descriptor tables allocators
>   iommu/arm-smmu-v3: Add support for Substream IDs
>   iommu/arm-smmu-v3: Propate ssid_bits
>   iommu/arm-smmu-v3: Handle failure of arm_smmu_write_ctx_desc()
>   iommu/arm-smmu-v3: Add second level of context descriptor table
>   iommu/arm-smmu-v3: Improve add_device() error handling
>   PCI/ATS: Add PASID stubs
>   iommu/arm-smmu-v3: Add support for PCI PASID
> 
>  .../devicetree/bindings/iommu/iommu.txt       |   6 +
>  drivers/acpi/arm64/iort.c                     |  18 +
>  drivers/iommu/arm-smmu-v3.c                   | 462 +++++++++++++++---
>  drivers/iommu/of_iommu.c                      |   6 +-
>  include/linux/iommu.h                         |   2 +
>  include/linux/pci-ats.h                       |   3 +
>  6 files changed, 437 insertions(+), 60 deletions(-)
>