diff -r bf9cdbec516a xen/drivers/passthrough/vtd/dmar.c --- a/xen/drivers/passthrough/vtd/dmar.c Wed Feb 11 16:36:59 2009 +0000 +++ b/xen/drivers/passthrough/vtd/dmar.c Wed Feb 11 19:19:57 2009 -0500 @@ -519,8 +519,6 @@ int acpi_dmar_init(void) { int rc; - struct acpi_drhd_unit *drhd; - struct iommu *iommu; rc = -ENODEV; if ( force_iommu ) @@ -537,22 +535,7 @@ if ( list_empty(&acpi_drhd_units) ) goto fail; - /* Giving that all devices within guest use same io page table, - * enable snoop control only if all VT-d engines support it. - */ - if ( iommu_snoop ) - { - for_each_drhd_unit ( drhd ) - { - iommu = drhd->iommu; - if ( !ecap_snp_ctl(iommu->ecap) ) { - iommu_snoop = 0; - break; - } - } - } - - printk("Intel VT-d has been enabled, snoop_control=%d.\n", iommu_snoop); + printk("Intel VT-d has been enabled\n"); return 0; diff -r bf9cdbec516a xen/drivers/passthrough/vtd/iommu.c --- a/xen/drivers/passthrough/vtd/iommu.c Wed Feb 11 16:36:59 2009 +0000 +++ b/xen/drivers/passthrough/vtd/iommu.c Wed Feb 11 19:19:57 2009 -0500 @@ -1765,6 +1765,23 @@ if ( init_vtd_hw() ) goto error; + /* Giving that all devices within guest use same io page table, + * enable snoop control only if all VT-d engines support it. + */ + + if ( iommu_snoop ) + { + for_each_drhd_unit ( drhd ) + { + iommu = drhd->iommu; + if ( !ecap_snp_ctl(iommu->ecap) ) { + iommu_snoop = 0; + break; + } + } + } + + printk("Intel VT-d snoop control %sabled\n", iommu_snoop ? "en" : "dis"); register_keyhandler('V', dump_iommu_info, "dump iommu info"); return 0; @@ -1773,6 +1790,7 @@ for_each_drhd_unit ( drhd ) iommu_free(drhd); vtd_enabled = 0; + iommu_snoop = 0; return -ENOMEM; }