From: "Jan Beulich" Subject: [PATCH] x86: fix tboot after c/s 23013:65d26504e843 (ACPI cleanup) Date: Fri, 25 Mar 2011 16:01:52 +0000 Message-ID: <4D8CCA800200007800038689@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part7559B960.1__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" Cc: Joseph Cihula , Gang Wei List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part7559B960.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline TXT code calls acpi_parse_dmar() with a transient copy of the DMAR table, and hence storing the pointer for later reference was wrong. Obtain the pointer in acpi_dmar_init() instead. Signed-off-by: Jan Beulich Tested-by: Gang Wei --- a/xen/drivers/passthrough/vtd/dmar.c +++ b/xen/drivers/passthrough/vtd/dmar.c @@ -673,7 +673,6 @@ static int __init acpi_parse_dmar(struct u8 dmar_host_address_width; int ret =3D 0; =20 - dmar_table =3D table; dmar =3D (struct acpi_table_dmar *)table; =20 if ( !iommu_enabled ) @@ -762,6 +761,13 @@ out: =20 int __init acpi_dmar_init(void) { + unsigned long flags; + + /* Disabling IRQs avoids cross-CPU TLB flush in map_pages_to_xen(). = */ + local_irq_save(flags); + acpi_get_table(ACPI_SIG_DMAR, 0, &dmar_table); + local_irq_restore(flags); + return parse_dmar_table(acpi_parse_dmar); } =20 --=__Part7559B960.1__= Content-Type: text/plain; name="acpi-tboot-fix-23013.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="acpi-tboot-fix-23013.patch" TXT code calls acpi_parse_dmar() with a transient copy of the DMAR=0Atable,= and hence storing the pointer for later reference was wrong.=0AObtain the = pointer in acpi_dmar_init() instead.=0A=0ASigned-off-by: Jan Beulich = =0ATested-by: Gang Wei =0A=0A--- = a/xen/drivers/passthrough/vtd/dmar.c=0A+++ b/xen/drivers/passthrough/vtd/dm= ar.c=0A@@ -673,7 +673,6 @@ static int __init acpi_parse_dmar(struct=0A = u8 dmar_host_address_width;=0A int ret =3D 0;=0A =0A- dmar_table = =3D table;=0A dmar =3D (struct acpi_table_dmar *)table;=0A =0A if = ( !iommu_enabled )=0A@@ -762,6 +761,13 @@ out:=0A =0A int __init acpi_dmar_= init(void)=0A {=0A+ unsigned long flags;=0A+=0A+ /* Disabling IRQs = avoids cross-CPU TLB flush in map_pages_to_xen(). */=0A+ local_irq_save(= flags);=0A+ acpi_get_table(ACPI_SIG_DMAR, 0, &dmar_table);=0A+ = local_irq_restore(flags);=0A+=0A return parse_dmar_table(acpi_parse_dma= r);=0A }=0A =0A --=__Part7559B960.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part7559B960.1__=--