On Sat, Sep 21, 2013 at 09:59:00PM -0500, David Woodhouse wrote:
> I *hate* the bizarre calling convention for iommu_unmap(). Is it
> actually clearly documented anywhere? Why on earth is it not just
> returning void, and expected to unmap what it was *asked* to unmap?
Yeah, I agree that this should be documented since it is quite
non-standard/non-obvious behaviour of a function. The reason the
interface was implemented this way is that the caller should not need to
know (or keep track of) the page-size which was used to map a given iova.
So the interface is basically, that you give an iova and a size and the
iommu driver unmaps _at_least_ a region of that size. But if you ask for
a 4k region which is mapped by a 2M page then the whole 2M are unmapped.
The return value tells you how much was actually unmapped.
Not the best interface, I know. We should come up with a better way to
handle this.
Joerg
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu