From: David Woodhouse Date: Sat, 28 May 2011 23:37:43 +0000 (+0100) Subject: intel-iommu: Fix inappropriate use of superpages in __domain_mapping() X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=601b737ecd1f780d1f3bddbaa6cfd58b208a79ae;p=pandora-kernel.git intel-iommu: Fix inappropriate use of superpages in __domain_mapping() After deciding to use a superpage, we were blindly continuing to do so even when the remaining size to be mapped was not enough for another superpage. Fix the logic to switch back to smaller pages as necessary. This means we can remove the bogus comparisons of nr_pages and sg_res with lvl_pages — they must *never* be smaller. That would mean we'd set up a mapping which is longer than we were asked to. Change those checks to BUG_ON() instead. Signed-off-by: David Woodhouse --- Reading git-diff-tree failed