diff -r e265055ce11c xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Thu Jan 22 14:05:23 2009 -0500 +++ b/xen/drivers/passthrough/vtd/iommu.c Wed Feb 04 05:47:08 2009 -0500 @@ -1039,6 +1039,7 @@ ASSERT(spin_is_locked(&pcidevs_lock)); spin_lock(&iommu->lock); + gdprintk(XENLOG_INFO VTDPREFIX, "domain_context_mapping_one: 1\n"); maddr = bus_to_context_maddr(iommu, bus); context_entries = (struct context_entry *)map_vtd_domain_page(maddr); context = &context_entries[devfn]; @@ -1054,6 +1055,7 @@ res = -EINVAL; unmap_vtd_domain_page(context_entries); spin_unlock(&iommu->lock); + gdprintk(XENLOG_INFO VTDPREFIX, "domain_context_mapping_one: 2\n"); return res; } @@ -1066,6 +1068,7 @@ else { spin_lock(&hd->mapping_lock); + gdprintk(XENLOG_INFO VTDPREFIX, "domain_context_mapping_one: 3\n"); /* Ensure we have pagetables allocated down to leaf PTE. */ if ( hd->pgd_maddr == 0 ) @@ -1077,6 +1080,7 @@ spin_unlock(&hd->mapping_lock); spin_unlock(&iommu->lock); unmap_vtd_domain_page(context_entries); + gdprintk(XENLOG_INFO VTDPREFIX, "domain_context_mapping_one: 4\n"); return -ENOMEM; } } @@ -1120,6 +1124,7 @@ set_bit(iommu->index, &hd->iommu_bitmap); unmap_vtd_domain_page(context_entries); + gdprintk(XENLOG_INFO VTDPREFIX, "domain_context_mapping_one: 5\n"); return 0; } @@ -1268,12 +1273,16 @@ secdevfn = devfn; devfn = bus2bridge[bus].devfn; bus = bus2bridge[bus].bus; + gdprintk(XENLOG_INFO VTDPREFIX, + "domain_context_mapping:bus2bridge: bdf = %x:%x.%x\n", + bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn); if ( ret ) return ret; } if ( (secbus != bus) && (secdevfn != 0) ) + { /* * The source-id for transactions on non-PCIe buses seem * to originate from devfn=0 on the secondary bus behind @@ -1281,7 +1290,11 @@ * these scanarios is not particularly well documented * anywhere. */ + gdprintk(XENLOG_INFO VTDPREFIX, + "domain_context_mapping:secbus: bdf = %x:%x.%x\n", + secbus, 0, 0); ret = domain_context_mapping_one(domain, drhd->iommu, secbus, 0); + } break; default: