intel-iommu: dump mappings but don't die on pte already set
authorDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 29 Jun 2009 21:06:43 +0000 (22:06 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 30 Jun 2009 02:55:21 +0000 (03:55 +0100)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/pci/intel-iommu.c

index 14308533b1cb867012c6f3ea12cd711f8b9f0b1c..40ce5a03f18f296bb41e1a9db94899bb583e1e68 100644 (file)
@@ -1673,7 +1673,16 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
                /* We don't need lock here, nobody else
                 * touches the iova range
                 */
-               BUG_ON(dma_pte_addr(pte));
+               if (unlikely(dma_pte_addr(pte))) {
+                       static int dumps = 5;
+                       printk(KERN_CRIT "ERROR: DMA PTE for vPFN 0x%lx already set (to %llx)\n",
+                              iov_pfn, pte->val);
+                       if (dumps) {
+                               dumps--;
+                               debug_dma_dump_mappings(NULL);
+                       }
+                       WARN_ON(1);
+               }
                pte->val = pteval;
                pte++;
                if (!nr_pages ||