From: Espen Skoglund Subject: Re: Workaround for the corrupted Intel X48 DMAR table Date: Mon, 14 Jul 2008 14:21:04 +0100 Message-ID: <18555.21184.889331.514348@gargle.gargle.HOWL> References: <5d649bdb0807132347y23d19142n4f07eacb16d0845e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "Zhao, Yu" , xen-devel@lists.xensource.com, "Han, Weidong" , Neo Jia , Jean Guyader List-Id: xen-devel@lists.xenproject.org [Keir Fraser] > On 14/7/08 07:47, "Neo Jia" wrote: >> In line: 0100: 00 00 00 80 00 00 00 00 ff ff ff 7f 00 00 00 00, the R= MRR >> reserved memory region starting address is even higher than its limit = address. >>=20 >> Is there anyway to do a software workaround for this issue? I tried >> to simply ignore that entry in the "acpi_parse_one_rmrr" function, >> but I hit a panic in function "iommu_enable_translation". > This kind of thing makes me quite uneasy about enabling VT-d by > default in Xen 3.3. I=B9m quite tempted to require =8Ciommu=B9 on the > command line to enable it. I've had ACPI problems with the Dell T7400 as well. Using an unpatched Xen caused the system to hangup during startup. Dell only managed to release a BIOS upgrade that fixed the problem less than two weeks ago. Anyhow, the very least one should do is to disable VT-d if parsing the ACPI DMAR fails. I've attached a patch which does this. It's then only a matter of returning an error if any of the DMAR tables look suspicious. eSk -- vt-d: Disable VT-d if parsing ACPI DMAR fails Signed-off-by: Espen Skoglund diff -r b80d6639cad4 xen/drivers/passthrough/vtd/dmar.c --- a/xen/drivers/passthrough/vtd/dmar.c Mon Jul 14 12:54:37 2008 +0100 +++ b/xen/drivers/passthrough/vtd/dmar.c Mon Jul 14 14:12:40 2008 +0100 @@ -82,6 +82,29 @@ static int __init acpi_register_rmrr_uni { list_add(&rmrr->list, &acpi_rmrr_units); 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); + } } =20 static int acpi_ioapic_device_match( @@ -436,6 +459,12 @@ static int __init acpi_parse_dmar(struct /* Zap APCI DMAR signature to prevent dom0 using vt-d HW. */ dmar->header.signature[0] =3D '\0'; =20 + if ( ret ) + { + printk(XENLOG_WARNING "Failed to parse ACPI DMAR. Disabling VT-= d.\n"); + disable_all_dmar_units(); + } + return ret; } =20