intel-iommu: fix superpage support in pfn_to_dma_pte()
commit5341e68f9b6c25c0a062de6d730034640988a605
authorAllen Kay <allen.m.kay@intel.com>
Fri, 14 Oct 2011 19:32:46 +0000 (14 12:32 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 Dec 2011 20:57:37 +0000 (21 12:57 -0800)
tree57d0741bf8617f8ff29bdf9a1cf070863bf1c34a
parentc46f906e93c81844de1c41e2e6fc1a6a36131c4f
intel-iommu: fix superpage support in pfn_to_dma_pte()

commit 4399c8bf2b9093696fa8160d79712e7346989c46 upstream.

If target_level == 0, current code breaks out of the while-loop if
SUPERPAGE bit is set. We should also break out if PTE is not present.
If we don't do this, KVM calls to iommu_iova_to_phys() will cause
pfn_to_dma_pte() to create mapping for 4KiB pages.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Youquan Song <youquan.song@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/intel-iommu.c