From: Miroslav Rezanina Subject: RE: [Xen-changelog] [xen-unstable]vt-d: Fixpanic in msi_msg_read_remap_rte with acpi=off Date: Fri, 16 Oct 2009 13:39:40 -0400 (EDT) Message-ID: <1355526396.331851255714780001.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> References: <2100769032.331721255714626691.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <2100769032.331721255714626691.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dexuan Cui Cc: xen-devel@lists.xensource.com, Keir Fraser List-Id: xen-devel@lists.xenproject.org ---- "Dexuan Cui" wrote: > From: "Dexuan Cui" > To: "Miroslav Rezanina" > Cc: "Keir Fraser" , xen-devel@lists.xensource.com > Sent: Friday, October 16, 2009 4:16:55 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna > Subject: RE: [Xen-changelog] [xen-unstable]vt-d: Fixpanic in msi_msg_read_remap_rte with acpi=off > > Hi Miroslav and Keir, > When acpi=off and we set iommu_enabled=0, the execution of xen can't > reach the acpi_find_matched_drhd_unit Miroslav explicitly points out > one by one. > I think I can give a cleaner fix. Please see the attached patch. > > Thanks, > -- Dexuan > Hi Dexuan, acpi_find_matched_drhd_unit can theoretically return NULL. Is one check so big overhead to risk segmentation fault? > > diff -r 0705efd9c69e xen/drivers/passthrough/iommu.c > --- a/xen/drivers/passthrough/iommu.c Fri Oct 16 09:04:53 2009 +0100 > +++ b/xen/drivers/passthrough/iommu.c Fri Oct 16 18:41:46 2009 +0800 > @@ -266,9 +266,13 @@ int iommu_setup(void) > { > int rc = -ENODEV; > > - rc = iommu_hardware_setup(); > - > - iommu_enabled = (rc == 0); > + if ( acpi_disabled ) > + iommu_enabled = 0; > + else > + { > + rc = iommu_hardware_setup(); > + iommu_enabled = (rc == 0); > + } > > if ( force_iommu && !iommu_enabled ) > panic("IOMMU setup failed, crash Xen for security purpose!\n"); I miss this part, so this one should be add. However, I would leave checks when calling acpi_find_matched_drhd_unit. -- Miroslav Rezanina Software Engineer - Virtualization Team - XEN kernel -- Miroslav Rezanina Software Engineer - Virtualization Team - XEN kernel