# HG changeset patch # User Keir Fraser # Date 1233748806 0 # Node ID 6058887e55d7096f8b32c1f0576c601b080dc879 # Parent 7e15ccb7bbd88e550ada6a6b86196cc4e5d880b6 vtd: Add a boot parameter option for snoop control capability for VT-d. The default is to use snoop control. Signed-off-by: Xin, Xiaohui Index: xen-3.3.1-testing/xen/drivers/passthrough/iommu.c =================================================================== --- xen-3.3.1-testing.orig/xen/drivers/passthrough/iommu.c +++ xen-3.3.1-testing/xen/drivers/passthrough/iommu.c @@ -34,6 +34,8 @@ int amd_iov_detect(void); * no-pv Disable IOMMU for PV domains (default) * force|required Don't boot unless IOMMU is enabled * passthrough Bypass VT-d translation for Dom0 + * snoop Utilize the snoop control for IOMMU (default) + * no-snoop Dont utilize the snoop control for IOMMU */ custom_param("iommu", parse_iommu_param); int iommu_enabled = 0; @@ -46,6 +48,7 @@ static void __init parse_iommu_param(cha { char *ss; iommu_enabled = 1; + iommu_snoop = 1; do { ss = strchr(s, ','); @@ -63,6 +66,10 @@ static void __init parse_iommu_param(cha force_iommu = 1; else if ( !strcmp(s, "passthrough") ) iommu_passthrough = 1; + else if ( !strcmp(s, "snoop") ) + iommu_snoop = 1; + else if ( !strcmp(s, "no-snoop") ) + iommu_snoop = 0; s = ss + 1; } while ( ss ); Index: xen-3.3.1-testing/xen/drivers/passthrough/vtd/dmar.c =================================================================== --- xen-3.3.1-testing.orig/xen/drivers/passthrough/vtd/dmar.c +++ xen-3.3.1-testing/xen/drivers/passthrough/vtd/dmar.c @@ -530,13 +530,15 @@ int acpi_dmar_init(void) /* Giving that all devices within guest use same io page table, * enable snoop control only if all VT-d engines support it. */ - iommu_snoop = 1; - for_each_drhd_unit ( drhd ) + if ( iommu_snoop ) { - iommu = drhd->iommu; - if ( !ecap_snp_ctl(iommu->ecap) ) { - iommu_snoop = 0; - break; + for_each_drhd_unit ( drhd ) + { + iommu = drhd->iommu; + if ( !ecap_snp_ctl(iommu->ecap) ) { + iommu_snoop = 0; + break; + } } }