iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] iommu/smmu-v3: Workaround for hisilicon 161010801 erratum(reserve HW MSI)
@ 2017-07-25 11:17 Shameer Kolothum
  2017-07-25 11:17 ` [PATCH v4 1/2] acpi:iort: Add an IORT helper function to reserve HW ITS address regions for IOMMU drivers Shameer Kolothum
  2017-07-25 11:17 ` [PATCH v4 2/2] iommu/dma: Add HW MSI address regions reservation " Shameer Kolothum
  0 siblings, 2 replies; 12+ messages in thread
From: Shameer Kolothum @ 2017-07-25 11:17 UTC (permalink / raw)
  To: lorenzo.pieralisi, marc.zyngier, sudeep.holla, will.deacon,
	robin.murphy, hanjun.guo
  Cc: gabriele.paoloni, john.garry, iommu, linux-arm-kernel, linux-acpi,
	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.

To implement this quirk, the following changes are incorporated:

1. Added a generic helper function to IORT code to retrieve and
   reserve the HW ITS address regions.
2. Modified iommu_dma_get_resv_regions() to reserve the hw msi
   regions which means these address regions will not be translated and
   will be excluded from iova allocations.

Thanks,
Shameer

Changelog:

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 (2):
  acpi:iort: Add an IORT helper function to reserve HW ITS address
    regions for IOMMU drivers
  iommu/dma: Add HW MSI address regions reservation for IOMMU drivers

 drivers/acpi/arm64/iort.c        | 91 ++++++++++++++++++++++++++++++++++++++--
 drivers/iommu/dma-iommu.c        |  8 +++-
 drivers/irqchip/irq-gic-v3-its.c |  3 +-
 include/linux/acpi_iort.h        |  8 +++-
 4 files changed, 104 insertions(+), 6 deletions(-)

-- 
1.9.1



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

end of thread, other threads:[~2017-07-28 15:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25 11:17 [PATCH v4 0/2] iommu/smmu-v3: Workaround for hisilicon 161010801 erratum(reserve HW MSI) Shameer Kolothum
2017-07-25 11:17 ` [PATCH v4 1/2] acpi:iort: Add an IORT helper function to reserve HW ITS address regions for IOMMU drivers Shameer Kolothum
     [not found]   ` <20170725111732.41792-2-shameerali.kolothum.thodi-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-07-25 17:11     ` Lorenzo Pieralisi
2017-07-25 17:32       ` Robin Murphy
     [not found]         ` <b7512f89-4fe7-940e-0fa9-9274d8b1e935-5wv7dgnIgG8@public.gmane.org>
2017-07-26  9:52           ` Lorenzo Pieralisi
2017-07-27  9:13             ` Shameerali Kolothum Thodi
2017-07-27 10:12               ` Lorenzo Pieralisi
2017-07-27 11:13               ` Robin Murphy
     [not found]                 ` <989fec76-45e7-d744-3411-78ec2764cb7d-5wv7dgnIgG8@public.gmane.org>
2017-07-27 13:26                   ` Shameerali Kolothum Thodi
2017-07-28  9:57                     ` Lorenzo Pieralisi
2017-07-28 15:48                       ` Shameerali Kolothum Thodi
2017-07-25 11:17 ` [PATCH v4 2/2] iommu/dma: Add HW MSI address regions reservation " Shameer Kolothum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).