From: Alex Williamson Date: Sat, 15 Jun 2013 16:27:19 +0000 (-0600) Subject: intel-iommu: Fix leaks in pagetable freeing X-Git-Tag: v3.12-rc1~33^2^6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3269ee0bd6686baf86630300d528500ac5b516d7;p=pandora-kernel.git intel-iommu: Fix leaks in pagetable freeing At best the current code only seems to free the leaf pagetables and the root. If you're unlucky enough to have a large gap (like any QEMU guest with more than 3G of memory), only the first chunk of leaf pagetables are freed (plus the root). This is a massive memory leak. This patch re-writes the pagetable freeing function to use a recursive algorithm and manages to not only free all the pagetables, but does it without any apparent performance loss versus the current broken version. Signed-off-by: Alex Williamson Cc: stable@vger.kernel.org Reviewed-by: Marcelo Tosatti Signed-off-by: Joerg Roedel --- Reading git-diff-tree failed