summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/io-pgtable.h
diff options
context:
space:
mode:
authorRobin Murphy2015-07-29 20:46:04 +0200
committerWill Deacon2015-08-06 15:35:38 +0200
commitf8d5496131554f61b0fd931fa046f0233fe2aac2 (patch)
treef7a7855797693f1a9c101cb4dc4dd234a54d5ce2 /drivers/iommu/io-pgtable.h
parentiommu/arm-smmu: Treat unknown OAS as 48-bit (diff)
downloadkernel-qcow2-linux-f8d5496131554f61b0fd931fa046f0233fe2aac2.tar.gz
kernel-qcow2-linux-f8d5496131554f61b0fd931fa046f0233fe2aac2.tar.xz
kernel-qcow2-linux-f8d5496131554f61b0fd931fa046f0233fe2aac2.zip
iommu/io-pgtable-arm: Allow appropriate DMA API use
Currently, users of the LPAE page table code are (ab)using dma_map_page() as a means to flush page table updates for non-coherent IOMMUs. Since from the CPU's point of view, creating IOMMU page tables *is* passing DMA buffers to a device (the IOMMU's page table walker), there's little reason not to use the DMA API correctly. Allow IOMMU drivers to opt into DMA API operations for page table allocation and updates by providing their appropriate device pointer. The expectation is that an LPAE IOMMU should have a full view of system memory, so use streaming mappings to avoid unnecessary pressure on ZONE_DMA, and treat any DMA translation as a warning sign. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/iommu/io-pgtable.h')
-rw-r--r--drivers/iommu/io-pgtable.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/io-pgtable.h b/drivers/iommu/io-pgtable.h
index 10e32f69c668..c69529c78914 100644
--- a/drivers/iommu/io-pgtable.h
+++ b/drivers/iommu/io-pgtable.h
@@ -41,6 +41,8 @@ struct iommu_gather_ops {
* @ias: Input address (iova) size, in bits.
* @oas: Output address (paddr) size, in bits.
* @tlb: TLB management callbacks for this set of tables.
+ * @iommu_dev: The device representing the DMA configuration for the
+ * page table walker.
*/
struct io_pgtable_cfg {
#define IO_PGTABLE_QUIRK_ARM_NS (1 << 0) /* Set NS bit in PTEs */
@@ -49,6 +51,7 @@ struct io_pgtable_cfg {
unsigned int ias;
unsigned int oas;
const struct iommu_gather_ops *tlb;
+ struct device *iommu_dev;
/* Low-level data specific to the table format */
union {