iommu/vt-d: change intel-iommu to use IOVA frame numbers
authorOmer Peleg <omer@cs.technion.ac.il>
Wed, 20 Apr 2016 08:33:57 +0000 (11:33 +0300)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 20 Apr 2016 19:07:22 +0000 (15:07 -0400)
commit2aac630429d986a43ac59525a4cff47a624dc58e
treeb007758a4aa3cf32fc5388037d3594ac169915ef
parent0824c5920b16fe11034f3b5d2d48456d282d83f9
iommu/vt-d: change intel-iommu to use IOVA frame numbers

Make intel-iommu map/unmap/invalidate work with IOVA pfns instead of
pointers to "struct iova". This avoids using the iova struct from the IOVA
red-black tree and the resulting explicit find_iova() on unmap.

This patch will allow us to cache IOVAs in the next patch, in order to
avoid rbtree operations for the majority of map/unmap operations.

Note: In eliminating the find_iova() operation, we have also eliminated
the sanity check previously done in the unmap flow. Arguably, this was
overhead that is better avoided in production code, but it could be
brought back as a debug option for driver development.

Signed-off-by: Omer Peleg <omer@cs.technion.ac.il>
[mad@cs.technion.ac.il: rebased, fixed to not break iova api, and reworded
 the commit message]
Signed-off-by: Adam Morrison <mad@cs.technion.ac.il>
Reviewed-by: Shaohua Li <shli@fb.com>
Reviewed-by: Ben Serebrin <serebrin@google.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/iommu/intel-iommu.c