Commit Graph

6 Commits

Author SHA1 Message Date
Liam Mark
8b111f13d5 iommu/arm-smmu: add support to configure IOVA range
Allow clients to specify the IOVA range for fastmap clients
via the DOMAIN_ATTR_GEOMETRY domain attribute.

Presently fastmap only allocates page tables for the IOVA
range specified during the create mapping call. However
clients may want to use IOVA addresses outside this range,
such as for their calls to iommu_map.

So allow clients to extend the available IOVA space by setting
the DOMAIN_ATTR_GEOMETRY domain attribute's
iommu_domain_geometry.aperture_start to
the new start address of the IOVA space and by setting
iommu_domain_geometry.aperture_end to the new end address of the
IOVA space.
The new IOVA space created by iommu_domain_geometry.aperture_start
and iommu_domain_geometry.aperture_end will be a superset of the
IOVA range which was created through the create mapping call.

The DOMAIN_ATTR_GEOMETRY domain attribute can only be set before
attaching.
Calls to set the DOMAIN_ATTR_GEOMETRY domain attribute can only
be used to extend the IOVA space, it cannot shrink the range.

Note that extending the IOVA range will not change the range of
IOVA addresses which will be available to the DMA APIs.

CRs-Fixed: 2035925
Change-Id: Ib389e019a022d98417884002de08115fb0fc9384
Signed-off-by: Liam Mark <lmark@codeaurora.org>
[guptap@codeaurora.org: update geometry.aperture with mapping]
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
2020-01-29 14:07:18 +05:30
Shiraz Hashim
86f8167cf0 iommu/io-pgtable-fast: optimize statically allocated pages
Presently fastmap iommu feature allocates page tables for
full 4GB virtual address space. This can be optimized to
consider virtual address range [base, size] needed by
client and prepare page tables only for applicable
region.

CRs-Fixed: 2011508
Change-Id: Ie6c23cb8e1702a823567e126f452b1e72d851f71
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
2020-01-29 14:07:18 +05:30
Rishabh Bhatnagar
e9a05bb4d3 spdx: Modify spdx tag from GPL-2.0 to GPL-2.0-only
Modify spdx tag for all CAF authored files for Kona.

Change-Id: I9308c7189412b1e428a7f67ded0dc076b0e38254
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
2018-12-10 11:09:45 -08:00
Patrick Daly
15af6274ea dma-mapping-fast: Add support for dma operations with sg_table
Reuse functionality for reorganizing a sg_table based on
iommu granularity and device dma segment size from dma-iommu.c.

Port dma_sync_sg_for_* from arm64.

Change-Id: I87a7f917a39feff4f201340bbf1b5c2b4c6d9101
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
2018-10-30 18:03:01 -07:00
Patrick Daly
913c386090 iommu: io-pgtable-fast: Separate dma and io-pagetable layers
The io-pgtable layer should be responsible for
1) Reading/modifying the pagetable
2) Performing cpu cache maintenance on the pagetable

Remove code which does this from the DMA layer, and re-add it in
the io-pgtable layer, if duplicate functionality does not already
exist.

Change-Id: I2250c0f574b933f524ff464f6539ea6db1699729
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
2018-10-30 18:03:00 -07:00
Swathi Sridhar
4008eb493a iommu/arm-smmu: Merge of smmu changes from 4.14 to msm-kona
This patch is to merge all of iommu/smmu, DMA, fast and lazy
mapping changes from msm-4.14 to msm-kona.

Change-Id: I08777236f45357b7cf44f5c14c80b78eaa482294
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
2018-07-19 19:33:35 -07:00