ia64/xen-unstable

changeset 18054:e3ead65e75b2

vt-d: Disable VT-d if parsing ACPI DMAR fails

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Jul 14 15:20:35 2008 +0100 (2008-07-14)
parents 750919688b61
children 63317b6c3eab
files xen/drivers/passthrough/vtd/dmar.c
line diff
     1.1 --- a/xen/drivers/passthrough/vtd/dmar.c	Mon Jul 14 13:26:45 2008 +0100
     1.2 +++ b/xen/drivers/passthrough/vtd/dmar.c	Mon Jul 14 15:20:35 2008 +0100
     1.3 @@ -84,6 +84,29 @@ static int __init acpi_register_rmrr_uni
     1.4      return 0;
     1.5  }
     1.6  
     1.7 +static void __init disable_all_dmar_units(void)
     1.8 +{
     1.9 +    struct acpi_drhd_unit *drhd, *_drhd;
    1.10 +    struct acpi_rmrr_unit *rmrr, *_rmrr;
    1.11 +    struct acpi_atsr_unit *atsr, *_atsr;
    1.12 +
    1.13 +    list_for_each_entry_safe ( drhd, _drhd, &acpi_drhd_units, list )
    1.14 +    {
    1.15 +        list_del(&drhd->list);
    1.16 +        xfree(drhd);
    1.17 +    }
    1.18 +    list_for_each_entry_safe ( rmrr, _rmrr, &acpi_rmrr_units, list )
    1.19 +    {
    1.20 +        list_del(&rmrr->list);
    1.21 +        xfree(rmrr);
    1.22 +    }
    1.23 +    list_for_each_entry_safe ( atsr, _atsr, &acpi_atsr_units, list )
    1.24 +    {
    1.25 +        list_del(&atsr->list);
    1.26 +        xfree(atsr);
    1.27 +    }
    1.28 +}
    1.29 +
    1.30  static int acpi_ioapic_device_match(
    1.31      struct list_head *ioapic_list, unsigned int apic_id)
    1.32  {
    1.33 @@ -436,6 +459,12 @@ static int __init acpi_parse_dmar(struct
    1.34      /* Zap APCI DMAR signature to prevent dom0 using vt-d HW. */
    1.35      dmar->header.signature[0] = '\0';
    1.36  
    1.37 +    if ( ret )
    1.38 +    {
    1.39 +        printk(XENLOG_WARNING "Failed to parse ACPI DMAR.  Disabling VT-d.\n");
    1.40 +        disable_all_dmar_units();
    1.41 +    }
    1.42 +
    1.43      return ret;
    1.44  }
    1.45