From: Miroslav Rezanina Subject: Re: RE: [Xen-changelog] [xen-unstable]vt-d: Fixpanic in msi_msg_read_remap_rte with acpi=off Date: Mon, 19 Oct 2009 04:34:29 -0400 (EDT) Message-ID: <1079004822.361571255941269372.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> References: <1949920474.361541255941211791.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1949920474.361541255941211791.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: xen-devel@lists.xensource.com, "Keir Fraser" > Sent: Monday, October 19, 2009 9:38:12 AM GMT +01:00 Amsterdam / Berlin /= Bern / Rome / Stockholm / Vienna > Subject: [Xen-devel] RE: [Xen-changelog] [xen-unstable]vt-d: Fixpanic in = msi_msg_read_remap_rte with acpi=3Doff > > Hi Miroslav, > I agree we should program defensively. > However, here when acpi=3Doff and iommu=3D1, or when iommu=3D0, with my "= if > ( acpi_disabled ) iommu_enabled =3D 0" checking, I believe xen's > execution can't reach the places you pointed out. > And when (by default acpi=3Don and ) iommu=3D1, normally the places can't > return NULL either, otherwise the BIOS is buggy or Xen has a bug; in > these cases, we can't simply ignore it silently -- I think we should > at least print a warning message. > So how about my attached new patch? >=20 > Thanks, > -- Dexuan >=20 Hi Dexuan, you're right. We should print warning. In your patch, I do not understand= =20 why you put comment only in setup_dom0_devices function. There is more=20 calling of domain_context_mapping and we check NULL also in domain_context_= unmap and reassign_device_ownership. We should put warning in there too, shouldn'= t we? Regards, Mirek >=20 >=20 > -----Original Message----- > From: Miroslav Rezanina [mailto:mrezanin@redhat.com]=20 > Sent: 2009=E5=B9=B410=E6=9C=8817=E6=97=A5 1:40 > To: Cui, Dexuan > Cc: Keir Fraser; xen-devel@lists.xensource.com > Subject: RE: [Xen-changelog] [xen-unstable]vt-d: Fixpanic in > msi_msg_read_remap_rte with acpi=3Doff >=20 > ---- "Dexuan Cui" wrote: >=20 > > 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=3Doff > > > > Hi Miroslav and Keir, > > When acpi=3Doff and we set iommu_enabled=3D0, 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. > >=20 > > Thanks, > > -- Dexuan > >=20 > Hi Dexuan, > acpi_find_matched_drhd_unit can theoretically return NULL. Is one > check so big overhead to risk > segmentation fault?=20 > >=20 > > 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 =3D -ENODEV; > >=20 > > - rc =3D iommu_hardware_setup(); > > - > > - iommu_enabled =3D (rc =3D=3D 0); > > + if ( acpi_disabled ) > > + iommu_enabled =3D 0; > > + else > > + { > > + rc =3D iommu_hardware_setup(); > > + iommu_enabled =3D (rc =3D=3D 0); > > + } > >=20 > > if ( force_iommu && !iommu_enabled ) > > panic("IOMMU setup failed, crash Xen for security > purpose!\n"); >=20 > I miss this part, so this one should be add. However, I would leave > checks when calling acpi_find_matched_drhd_unit. > --=20 > Miroslav Rezanina > Software Engineer - Virtualization Team - XEN kernel >=20 > --=20 > Miroslav Rezanina > Software Engineer - Virtualization Team - XEN kernel >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel --=20 Miroslav Rezanina Software Engineer - Virtualization Team - XEN kernel