From mboxrd@z Thu Jan 1 00:00:00 1970 From: ZhouPeng Subject: Re: Re: Panic on cpu0 Date: Thu, 16 Dec 2010 23:18:59 +0800 Message-ID: References: <20101216075912.GG2754@reaktio.net> <4D0A0A7F0200007800028595@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0638033451==" Return-path: In-Reply-To: <4D0A0A7F0200007800028595@vpn.id2.novell.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: Jan Beulich Cc: "Xen-Devel (E-mail)" , keir.fraser@eu.citrix.com List-Id: xen-devel@lists.xenproject.org --===============0638033451== Content-Type: multipart/alternative; boundary=001485e7c7cabc1e4a04978892cc --001485e7c7cabc1e4a04978892cc Content-Type: text/plain; charset=ISO-8859-1 The patch works. Thanks. 2010/12/16 Jan Beulich > >>> On 16.12.10 at 10:30, ZhouPeng wrote: > > The err msg appears in > > void *map_domain_page(unsigned long mfn) > > BUG_ON(idx >= MAPCACHE_ENTRIES); > > > > printk idx is 1024 and BUG_ON is called. > > > > I print Xen call trace msg: > > > > [] map_domain_page+0x1a2/0x230 > > [] unmap_domain_page+0x148/0x160 > > addr_to_dma_page_maddr+0x1f6/0x250 > > __find_next_zero_bit+0x80/0x90 > > intel_iommu_map_page+0x14a/0x250 > > domain_context_mapping+0x14a/0x250 > > rmrr_identity_mapping+0xb7/0x120 > > intel_iommu_dom0_init+0x143/0x1eb > > construct_dom0+0x138f/0x16b0 > > __start_xen+0x109a/0x1680 > > e820nf+0x0/0x4 > > __high_start+0x58/0x5a > > Could you give the below patch a try? > > Jan > > --- a/xen/drivers/passthrough/vtd/iommu.c > +++ b/xen/drivers/passthrough/vtd/iommu.c > @@ -1331,6 +1331,7 @@ int domain_context_mapping_one( > if ( context_set_domain_id(context, domain, iommu) ) > { > spin_unlock(&iommu->lock); > + unmap_vtd_domain_page(context_entries); > return -EFAULT; > } > > @@ -1672,6 +1673,7 @@ static int intel_iommu_map_page( > if ( old.val == new.val ) > { > spin_unlock(&hd->mapping_lock); > + unmap_vtd_domain_page(page); > return 0; > } > *pte = new; > > > -- Zhou Peng My daily E-Mail: ailvpeng25@gmail.com --001485e7c7cabc1e4a04978892cc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable The patch works.
Thanks.

2010/12/16 Ja= n Beulich <JBeu= lich@novell.com>
>>> On 16.12.10 at 10:30, ZhouPeng <zpengxen@gmail.com> wrote:
> The err msg appears in
> void *map_domain_page(unsigned long mfn)
> =A0 =A0 =A0 BUG_ON(idx >=3D MAPCACHE_ENTRIES);
>
> printk idx is 1024 and BUG_ON is called.
>
> I print =A0Xen call trace msg:
>
> [<ffcd3c2>] =A0map_domain_page+0x1a2/0x230
> [<ff1cd718>] unmap_domain_page+0x148/0x160
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0addr_to_dma_page_maddr+0x1f6/0x= 250
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0__find_next_zero_bit+0x80/0x90<= br> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0intel_iommu_map_page+0x14a/0x25= 0
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0domain_context_mapping+0x14a/0x= 250
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0rmrr_identity_mapping+0xb7/0x12= 0
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0intel_iommu_dom0_init+0x143/0x1= eb
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0construct_dom0+0x138f/0x16b0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0__start_xen+0x109a/0x1680
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0e820nf+0x0/0x4
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0__high_start+0x58/0x5a

Could you give the below patch a try?

Jan

--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1331,6 +1331,7 @@ int domain_context_mapping_one(
=A0 =A0 if ( context_set_domain_id(context, domain, iommu) )
=A0 =A0 {
=A0 =A0 =A0 =A0 spin_unlock(&iommu->lock);
+ =A0 =A0 =A0 =A0unmap_vtd_domain_page(context_entries);
=A0 =A0 =A0 =A0 return -EFAULT;
=A0 =A0 }

@@ -1672,6 +1673,7 @@ static int intel_iommu_map_page(
=A0 =A0 if ( old.val =3D=3D new.val )
=A0 =A0 {
=A0 =A0 =A0 =A0 spin_unlock(&hd->mapping_lock);
+ =A0 =A0 =A0 =A0unmap_vtd_domain_page(page);
=A0 =A0 =A0 =A0 return 0;
=A0 =A0 }
=A0 =A0 *pte =3D new;





--
Zhou Peng
My daily E= -Mail: ailvpeng25= @gmail.com
--001485e7c7cabc1e4a04978892cc-- --===============0638033451== 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 --===============0638033451==--