diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-07-14 15:20:35 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-07-14 15:20:35 +0100 |
commit | 1161d825c9343647ceea954aa0e5c908ec717131 (patch) | |
tree | 9919b868f8075f0eab95c4890e507349633eaa50 | |
parent | 55bfc14465bff9ef67dc697ef9c1432471b7290f (diff) | |
download | xen-1161d825c9343647ceea954aa0e5c908ec717131.tar.gz xen-1161d825c9343647ceea954aa0e5c908ec717131.tar.bz2 xen-1161d825c9343647ceea954aa0e5c908ec717131.zip |
vt-d: Disable VT-d if parsing ACPI DMAR fails
Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
-rw-r--r-- | xen/drivers/passthrough/vtd/dmar.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c index a6876ec6a3..501622edd1 100644 --- a/xen/drivers/passthrough/vtd/dmar.c +++ b/xen/drivers/passthrough/vtd/dmar.c @@ -84,6 +84,29 @@ static int __init acpi_register_rmrr_unit(struct acpi_rmrr_unit *rmrr) return 0; } +static void __init disable_all_dmar_units(void) +{ + struct acpi_drhd_unit *drhd, *_drhd; + struct acpi_rmrr_unit *rmrr, *_rmrr; + struct acpi_atsr_unit *atsr, *_atsr; + + list_for_each_entry_safe ( drhd, _drhd, &acpi_drhd_units, list ) + { + list_del(&drhd->list); + xfree(drhd); + } + list_for_each_entry_safe ( rmrr, _rmrr, &acpi_rmrr_units, list ) + { + list_del(&rmrr->list); + xfree(rmrr); + } + list_for_each_entry_safe ( atsr, _atsr, &acpi_atsr_units, list ) + { + list_del(&atsr->list); + xfree(atsr); + } +} + static int acpi_ioapic_device_match( struct list_head *ioapic_list, unsigned int apic_id) { @@ -436,6 +459,12 @@ static int __init acpi_parse_dmar(struct acpi_table_header *table) /* Zap APCI DMAR signature to prevent dom0 using vt-d HW. */ dmar->header.signature[0] = '\0'; + if ( ret ) + { + printk(XENLOG_WARNING "Failed to parse ACPI DMAR. Disabling VT-d.\n"); + disable_all_dmar_units(); + } + return ret; } |