ia64/xen-unstable

changeset 19156:6058887e55d7

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 <xiaohui.xin@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 04 12:00:06 2009 +0000 (2009-02-04)
parents 7e15ccb7bbd8
children 1b2fdbb33716
files xen/drivers/passthrough/iommu.c xen/drivers/passthrough/vtd/dmar.c
line diff
     1.1 --- a/xen/drivers/passthrough/iommu.c	Wed Feb 04 11:58:25 2009 +0000
     1.2 +++ b/xen/drivers/passthrough/iommu.c	Wed Feb 04 12:00:06 2009 +0000
     1.3 @@ -33,6 +33,8 @@ int amd_iov_detect(void);
     1.4   *   no-pv                      Disable IOMMU for PV domains (default)
     1.5   *   force|required             Don't boot unless IOMMU is enabled
     1.6   *   passthrough                Bypass VT-d translation for Dom0
     1.7 + *   snoop                      Utilize the snoop control for IOMMU (default)
     1.8 + *   no-snoop                   Dont utilize the snoop control for IOMMU
     1.9   */
    1.10  custom_param("iommu", parse_iommu_param);
    1.11  int iommu_enabled = 0;
    1.12 @@ -45,6 +47,7 @@ static void __init parse_iommu_param(cha
    1.13  {
    1.14      char *ss;
    1.15      iommu_enabled = 1;
    1.16 +    iommu_snoop = 1;
    1.17  
    1.18      do {
    1.19          ss = strchr(s, ',');
    1.20 @@ -62,6 +65,10 @@ static void __init parse_iommu_param(cha
    1.21              force_iommu = 1;
    1.22          else if ( !strcmp(s, "passthrough") )
    1.23              iommu_passthrough = 1;
    1.24 +        else if ( !strcmp(s, "snoop") )
    1.25 +            iommu_snoop = 1;
    1.26 +        else if ( !strcmp(s, "no-snoop") )
    1.27 +            iommu_snoop = 0;
    1.28  
    1.29          s = ss + 1;
    1.30      } while ( ss );
     2.1 --- a/xen/drivers/passthrough/vtd/dmar.c	Wed Feb 04 11:58:25 2009 +0000
     2.2 +++ b/xen/drivers/passthrough/vtd/dmar.c	Wed Feb 04 12:00:06 2009 +0000
     2.3 @@ -540,13 +540,15 @@ int acpi_dmar_init(void)
     2.4      /* Giving that all devices within guest use same io page table,
     2.5       * enable snoop control only if all VT-d engines support it.
     2.6       */
     2.7 -    iommu_snoop = 1;
     2.8 -    for_each_drhd_unit ( drhd )
     2.9 +    if ( iommu_snoop )
    2.10      {
    2.11 -        iommu = drhd->iommu;
    2.12 -        if ( !ecap_snp_ctl(iommu->ecap) ) {
    2.13 -            iommu_snoop = 0;
    2.14 -            break;
    2.15 +        for_each_drhd_unit ( drhd )
    2.16 +        {
    2.17 +            iommu = drhd->iommu;
    2.18 +            if ( !ecap_snp_ctl(iommu->ecap) ) {
    2.19 +                iommu_snoop = 0;
    2.20 +                break;
    2.21 +            }
    2.22          }
    2.23      }
    2.24