All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v9 0/4] iommu/smmu-v3: Workaround for hisilicon 161010801 erratum(reserve HW MSI)
@ 2017-10-06 14:04 ` Shameer Kolothum
  0 siblings, 0 replies; 96+ messages in thread
From: Shameer Kolothum @ 2017-10-06 14:04 UTC (permalink / raw)
  To: lorenzo.pieralisi, marc.zyngier, sudeep.holla, will.deacon,
	robin.murphy, joro, bhelgaas, gabriele.paoloni
  Cc: john.garry, iommu, linux-arm-kernel, linux-acpi, linux-pci,
	devel, linuxarm, wangzhou1, guohanjun, Shameer Kolothum

On certain HiSilicon platforms (hip06/hip07) the GIC ITS and PCIe RC
deviates from the standard implementation and this breaks PCIe MSI
functionality when SMMU is enabled.

The HiSilicon erratum 161010801 describes this limitation of certain
HiSilicon platforms to support the SMMU mappings for MSI transactions.
On these platforms GICv3 ITS translator is presented with the deviceID
by extending the MSI payload data to 64 bits to include the deviceID.
Hence, the PCIe controller on this platforms has to differentiate the MSI
payload against other DMA payload and has to modify the MSI payload.
This basically makes it difficult for this platforms to have a SMMU
translation for MSI.

This patch implements an ACPI and DT based quirk to reserve the hw msi
regions in the smmu-v3 driver which means these address regions will
not be translated and will be excluded from iova allocations.

To implement this quirk, the following changes are incorporated:
1. Added a generic helper function to IORT code to retrieve the
   associated ITS base address from a device IORT node.
2. Added a generic helper function to of iommu code to retrieve the
   associated msi controller base address from for a PCI RC
   msi-mapping and also platform device msi-parent.
3. Blacklisted HiSilicon PCIe controllers on DT based hip06/hip07
   platforms when SMMUv3 is enabled as there is no DT based solution
   for this as of now.

Changelog:

v8 --> v9
-Thanks to Marc, fixed IORT helper function to reserve the ITS 
 translater region only.
-Removed the DT support for MSI reservation and blacklisted
 HiSilicon PCIe controllers on DT based systems when SMMUv3 is
 enabled.

v7 --> v8
Addressed comments from Rob and Lorenzo:
 -Modified to use DT compatible string for errata.
 -Changed logic to retrieve the msi-parent for DT case.

v6 --> v7
Addressed request from Will to add DT support for the erratum:
 - added bt binding
 - add of_iommu_msi_get_resv_regions()
New arm64 silicon errata entry
Rename iort_iommu_{its->msi}_get_resv_regions

v5 --> v6
Addressed comments from Robin and Lorenzo:
-No change to patch#1 .
-Reverted v5 patch#2 as this might break the platforms where this quirk
  is not applicable. Provided a generic function in iommu code and added
  back the quirk implementation in SMMU v3 driver(patch#3)
 
v4 --> v5
Addressed comments from Robin and Lorenzo:
-Added a comment to make it clear that, for now, only straightforward 
  HW topologies are handled while reserving ITS regions(patch #1).

v3 --> v4
Rebased on 4.13-rc1.
Addressed comments from Robin, Will and Lorenzo:
-As suggested by Robin, moved the ITS msi reservation into 
  iommu_dma_get_resv_regions().
-Added its_count != resv region failure case(patch #1).

v2 --> v3
Addressed comments from Lorenzo and Robin:
-Removed dev_is_pci() check in smmuV3 driver.
-Don't treat device not having an ITS mapping as an error in
  iort helper function.

v1 --> v2
-patch 2/2: Invoke iort helper fn based on fwnode type(acpi).

RFCv2 -->PATCH
-Incorporated Lorenzo's review comments.

RFC v1 --> RFC v2
Based on Robin's review comments,
-Removed  the generic erratum framework.
-Using IORT/MADT tables to retrieve the ITS base addr instead  of vendor specific CSRT table.


Shameer Kolothum (4):
  ACPI/IORT: Add msi address regions reservation helper
  iommu/dma: Add a helper function to reserve HW MSI address regions for
    IOMMU drivers
  iommu/arm-smmu-v3:Enable ACPI based HiSilicon erratum 161010801
  PCI: hisi: blacklist hip06/hip07 controllers behind SMMUv3

 drivers/acpi/arm64/iort.c        | 97 ++++++++++++++++++++++++++++++++++++++--
 drivers/iommu/arm-smmu-v3.c      | 27 ++++++++---
 drivers/iommu/dma-iommu.c        | 20 +++++++++
 drivers/irqchip/irq-gic-v3-its.c |  3 +-
 drivers/pci/dwc/pcie-hisi.c      | 12 +++++
 include/linux/acpi_iort.h        |  7 ++-
 include/linux/dma-iommu.h        |  7 +++
 7 files changed, 163 insertions(+), 10 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 96+ messages in thread

end of thread, other threads:[~2017-11-07  9:38 UTC | newest]

Thread overview: 96+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 14:04 [PATCH v9 0/4] iommu/smmu-v3: Workaround for hisilicon 161010801 erratum(reserve HW MSI) Shameer Kolothum
2017-10-06 14:04 ` [Devel] " Shameer Kolothum
2017-10-06 14:04 ` Shameer Kolothum
2017-10-06 14:04 ` Shameer Kolothum
2017-10-06 14:04 ` [PATCH v9 1/4] ACPI/IORT: Add msi address regions reservation helper Shameer Kolothum
2017-10-06 14:04   ` [Devel] " Shameer Kolothum
2017-10-06 14:04   ` Shameer Kolothum
2017-10-06 14:04   ` Shameer Kolothum
2017-10-06 14:04 ` [PATCH v9 2/4] iommu/dma: Add a helper function to reserve HW MSI address regions for IOMMU drivers Shameer Kolothum
2017-10-06 14:04   ` [Devel] " Shameer Kolothum
2017-10-06 14:04   ` Shameer Kolothum
2017-10-06 14:04   ` Shameer Kolothum
2017-10-13 19:23   ` Will Deacon
2017-10-13 19:23     ` [Devel] " Will Deacon
2017-10-13 19:23     ` Will Deacon
2017-10-13 19:23     ` Will Deacon
2017-10-16 16:09     ` Shameerali Kolothum Thodi
2017-10-16 16:09       ` [Devel] " Shameerali Kolothum Thodi
2017-10-16 16:09       ` Shameerali Kolothum Thodi
2017-10-16 16:09       ` Shameerali Kolothum Thodi
     [not found]       ` <5FC3163CFD30C246ABAA99954A238FA83844672A-WFPaWmAhWqtUuCJht5byYAK1hpo4iccwjNknBlVQO8k@public.gmane.org>
2017-10-18 12:34         ` Robin Murphy
2017-10-18 12:34           ` [Devel] " Robin Murphy
2017-10-18 12:34           ` Robin Murphy
2017-10-18 12:34           ` Robin Murphy
2017-10-18 14:23           ` Shameerali Kolothum Thodi
2017-10-18 14:23             ` [Devel] " Shameerali Kolothum Thodi
2017-10-18 14:23             ` Shameerali Kolothum Thodi
2017-10-18 14:23             ` Shameerali Kolothum Thodi
2017-10-26 10:11           ` Shameerali Kolothum Thodi
2017-10-26 10:11             ` [Devel] " Shameerali Kolothum Thodi
2017-10-26 10:11             ` Shameerali Kolothum Thodi
2017-10-26 10:11             ` Shameerali Kolothum Thodi
2017-11-03 11:35             ` Lorenzo Pieralisi
2017-11-03 11:35               ` [Devel] " Lorenzo Pieralisi
2017-11-03 11:35               ` Lorenzo Pieralisi
2017-11-07  9:37               ` Shameerali Kolothum Thodi
2017-11-07  9:37                 ` [Devel] " Shameerali Kolothum Thodi
2017-11-07  9:37                 ` Shameerali Kolothum Thodi
2017-11-07  9:37                 ` Shameerali Kolothum Thodi
2017-10-06 14:04 ` [PATCH v9 3/4] iommu/arm-smmu-v3:Enable ACPI based HiSilicon erratum 161010801 Shameer Kolothum
2017-10-06 14:04   ` [Devel] " Shameer Kolothum
2017-10-06 14:04   ` Shameer Kolothum
2017-10-06 14:04   ` Shameer Kolothum
2017-10-06 14:04 ` [PATCH v9 4/4] PCI: hisi: blacklist hip06/hip07 controllers behind SMMUv3 Shameer Kolothum
2017-10-06 14:04   ` [Devel] " Shameer Kolothum
2017-10-06 14:04   ` Shameer Kolothum
2017-10-06 14:04   ` Shameer Kolothum
2017-10-06 14:27   ` Gabriele Paoloni
2017-10-06 14:27     ` Gabriele Paoloni
2017-10-06 14:27     ` Gabriele Paoloni
2017-10-09  8:32   ` Zhou Wang
2017-10-09  8:32     ` Zhou Wang
2017-10-09  8:32     ` Zhou Wang
2017-10-09 23:54   ` Bjorn Helgaas
2017-10-09 23:54     ` Bjorn Helgaas
2017-10-09 23:54     ` Bjorn Helgaas
     [not found]     ` <20171009235452.GP25517-1RhO1Y9PlrlHTL0Zs8A6p5iNqAH0jzoTYJqu5kTmcBRl57MIdRCFDg@public.gmane.org>
2017-10-10  0:15       ` Bjorn Helgaas
2017-10-10  0:15         ` Bjorn Helgaas
2017-10-10  0:15         ` Bjorn Helgaas
2017-10-10  9:42       ` Shameerali Kolothum Thodi
2017-10-10  9:42         ` [Devel] " Shameerali Kolothum Thodi
2017-10-10  9:42         ` Shameerali Kolothum Thodi
2017-10-10  9:42         ` Shameerali Kolothum Thodi
2017-10-10 10:06         ` Lorenzo Pieralisi
2017-10-10 10:06           ` [Devel] " Lorenzo Pieralisi
2017-10-10 10:06           ` Lorenzo Pieralisi
2017-10-10 10:06           ` Lorenzo Pieralisi
2017-10-10 10:19           ` Gabriele Paoloni
2017-10-10 10:19             ` Gabriele Paoloni
2017-10-10 10:19             ` Gabriele Paoloni
2017-10-10 10:51   ` Bjorn Helgaas
2017-10-10 10:51     ` Bjorn Helgaas
2017-10-13 19:22   ` Will Deacon
2017-10-13 19:22     ` [Devel] " Will Deacon
2017-10-13 19:22     ` Will Deacon
2017-10-13 19:22     ` Will Deacon
     [not found]     ` <20171013192209.GH30572-5wv7dgnIgG8@public.gmane.org>
2017-10-15  7:46       ` Shameerali Kolothum Thodi
2017-10-15  7:46         ` [Devel] " Shameerali Kolothum Thodi
2017-10-15  7:46         ` Shameerali Kolothum Thodi
2017-10-15  7:46         ` Shameerali Kolothum Thodi
2017-10-18 10:51         ` Will Deacon
2017-10-18 10:51           ` [Devel] " Will Deacon
2017-10-18 10:51           ` Will Deacon
2017-10-18 10:51           ` Will Deacon
     [not found]           ` <20171018105145.GC11669-5wv7dgnIgG8@public.gmane.org>
2017-10-18 12:25             ` Shameerali Kolothum Thodi
2017-10-18 12:25               ` [Devel] " Shameerali Kolothum Thodi
2017-10-18 12:25               ` Shameerali Kolothum Thodi
2017-10-18 12:25               ` Shameerali Kolothum Thodi
2017-10-18 13:45               ` Will Deacon
2017-10-18 13:45                 ` [Devel] " Will Deacon
2017-10-18 13:45                 ` Will Deacon
2017-10-18 13:45                 ` Will Deacon
     [not found] ` <20171006140450.89652-1-shameerali.kolothum.thodi-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-10-11 11:34   ` [PATCH v9 0/4] iommu/smmu-v3: Workaround for hisilicon 161010801 erratum(reserve HW MSI) Shameerali Kolothum Thodi
2017-10-11 11:34     ` [Devel] " Shameerali Kolothum Thodi
2017-10-11 11:34     ` Shameerali Kolothum Thodi
2017-10-11 11:34     ` Shameerali Kolothum Thodi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.