ia64/xen-unstable

changeset 18161:5e44f5d76432

vtd: There is only one INCLUDE_ALL DMAR unit in system, but no
restriction on whether it's the last unit.

Signed-off-by: Weidong Han <weidong.han@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jul 25 09:45:41 2008 +0100 (2008-07-25)
parents 7b6942ad565c
children 630ee9fd6f8c
files xen/drivers/passthrough/vtd/dmar.c
line diff
     1.1 --- a/xen/drivers/passthrough/vtd/dmar.c	Fri Jul 25 09:44:48 2008 +0100
     1.2 +++ b/xen/drivers/passthrough/vtd/dmar.c	Fri Jul 25 09:45:41 2008 +0100
     1.3 @@ -255,7 +255,7 @@ static int __init acpi_parse_dev_scope(v
     1.4              break;
     1.5          }
     1.6  
     1.7 -	case ACPI_DEV_MSI_HPET:
     1.8 +        case ACPI_DEV_MSI_HPET:
     1.9              dprintk(XENLOG_INFO VTDPREFIX, "found MSI HPET: bdf = %x:%x.%x\n",
    1.10                      bus, path->dev, path->fn);
    1.11              scope->devices[didx++] = PCI_BDF(bus, path->dev, path->fn);
    1.12 @@ -305,13 +305,6 @@ acpi_parse_one_drhd(struct acpi_dmar_ent
    1.13      int ret = 0;
    1.14      static int include_all = 0;
    1.15  
    1.16 -    if ( include_all )
    1.17 -    {
    1.18 -        dprintk(XENLOG_WARNING VTDPREFIX,
    1.19 -                "DMAR unit with INCLUDE_ALL is not not the last unit.\n");
    1.20 -        return -EINVAL;
    1.21 -    }
    1.22 -
    1.23      dmaru = xmalloc(struct acpi_drhd_unit);
    1.24      if ( !dmaru )
    1.25          return -ENOMEM;
    1.26 @@ -331,10 +324,17 @@ acpi_parse_one_drhd(struct acpi_dmar_ent
    1.27      if ( dmaru->include_all )
    1.28      {
    1.29          dprintk(XENLOG_INFO VTDPREFIX, "found INCLUDE_ALL\n");
    1.30 +        /* Only allow one INCLUDE_ALL */
    1.31 +        if ( include_all )
    1.32 +        {
    1.33 +            dprintk(XENLOG_WARNING VTDPREFIX,
    1.34 +                    "Onlyu onw INCLUDE_ALL device scope is allowed\n");
    1.35 +            return -EINVAL;
    1.36 +        }
    1.37          include_all = 1;
    1.38      }
    1.39  
    1.40 -    if ( ret )
    1.41 +    if ( ret || (dmaru->scope.devices_cnt == 0 && !dmaru->include_all) )
    1.42          xfree(dmaru);
    1.43      else
    1.44          acpi_register_drhd_unit(dmaru);