From 601b737ecd1f780d1f3bddbaa6cfd58b208a79ae Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 29 May 2011 00:37:43 +0100 Subject: [PATCH] intel-iommu: Fix inappropriate use of superpages in __domain_mapping() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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-format-patch failed