aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2015-01-12 12:51:15 -0500
committerJoerg Roedel <jroedel@suse.de>2015-01-19 08:55:22 -0500
commit1b72250076dde4276acecf3a7da722b185703e78 (patch)
tree86711d7e91dfb6ad914c23a18e8a12f5f30169ee /include/linux
parent85b4545629663486b7f71047ce3b54fa0ad3eb28 (diff)
iommu: Make IOVA domain low limit flexible
To share the IOVA allocator with other architectures, it needs to accommodate more general aperture restrictions; move the lower limit from a compile-time constant to a runtime domain property to allow IOVA domains with different requirements to co-exist. Also reword the slightly unclear description of alloc_iova since we're touching it anyway. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/iova.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/linux/iova.h b/include/linux/iova.h
index ad0507c61cc7..591b19626b46 100644
--- a/include/linux/iova.h
+++ b/include/linux/iova.h
@@ -16,9 +16,6 @@
16#include <linux/rbtree.h> 16#include <linux/rbtree.h>
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18 18
19/* IO virtual address start page frame number */
20#define IOVA_START_PFN (1)
21
22/* iova structure */ 19/* iova structure */
23struct iova { 20struct iova {
24 struct rb_node node; 21 struct rb_node node;
@@ -31,6 +28,7 @@ struct iova_domain {
31 spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ 28 spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */
32 struct rb_root rbroot; /* iova domain rbtree root */ 29 struct rb_root rbroot; /* iova domain rbtree root */
33 struct rb_node *cached32_node; /* Save last alloced node */ 30 struct rb_node *cached32_node; /* Save last alloced node */
31 unsigned long start_pfn; /* Lower limit for this domain */
34 unsigned long dma_32bit_pfn; 32 unsigned long dma_32bit_pfn;
35}; 33};
36 34
@@ -52,7 +50,8 @@ struct iova *alloc_iova(struct iova_domain *iovad, unsigned long size,
52struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo, 50struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo,
53 unsigned long pfn_hi); 51 unsigned long pfn_hi);
54void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to); 52void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to);
55void init_iova_domain(struct iova_domain *iovad, unsigned long pfn_32bit); 53void init_iova_domain(struct iova_domain *iovad, unsigned long start_pfn,
54 unsigned long pfn_32bit);
56struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn); 55struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn);
57void put_iova_domain(struct iova_domain *iovad); 56void put_iova_domain(struct iova_domain *iovad);
58struct iova *split_and_remove_iova(struct iova_domain *iovad, 57struct iova *split_and_remove_iova(struct iova_domain *iovad,