From: "Jan Beulich" Subject: Re: Bug in pirq_guest_unbind. Date: Wed, 09 Dec 2009 16:03:46 +0000 Message-ID: <4B1FD8720200007800024951@vpn.id2.novell.com> References: <20091209143049.GA3007@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20091209143049.GA3007@phenom.dumpdata.com> Content-Disposition: inline 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 , Konrad Rzeszutek Wilk Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >>> Konrad Rzeszutek Wilk 09.12.09 15:30 >>> >I've been able to generate this error by making the >xen_unmap_pirq request happen a bit too early in the shutdown >process of the guest. This does not happen with xm unless you >move some functions around. But nonethless it looks like >a racing issue. I was thinking to work on this at some point >but I still have work on the dom0 to finish up.So >if anybody wants to look at this I can give more details. > > >856] switch: port 2(vif1008.0) entering disabled state >[ 792.145541] device vif1008.0 left promiscuous mode >[ 79[ 792.169512] pciback pci-1008-0: fe state changed 6 >(XEN) irq.c:1514: dom1008: pirq 16 not mapped >(XEN) irq.c:1514: dom1008: pirq 16 not mapped >(XEN) irq.c:1522: dom1008: forcing unbind of pirq 17 >(XEN) ----[ Xen-3.5-unstable x86_64 debug=3Dy Tainted: C ]---- >(XEN) CPU: 2 >(XEN) RIP: e008:[] che021ff5fc78 rsp: ffff83021ff5f= c78 r8: 0000000040caba40 >(XEN) r9: 00000000deadbeef r10: ffff82c4801ff7a0 r11: 000000000000028= 2 >(XEN) r12: 0000000000000286 r13: ffff83821ff7f834 r14: 000000000000004= 4 >(XEN) r15: ffff83821ff7f800 cr0: 000000008005003b cr4: 00000000000006f= 0 >(XEN) cr3: 000000020b1b4000 cr2: ffff83821ff7f838 >(XEN) ds: 0000 es: 0000 fs: 0063 gs: 0000 ss: e010 cs: e008 >(XEN) Xen stack trace from rsp=3Dffff83021ff5fc78: >(XEN) ffff83021ff5fc98 ffff82c48011ddbe ffff83020ac62000 00000000ffffff= ef The last value is -17, so I guess a negative irq got returned here. c/s 18539 made this possible (still using vectors back then), but in changing (to introduce domain_spin_lock_irq_desc()) my originally submitted patch it seems like handling this possibility got partly lost (this new function declared vector [now irq] as 'unsigned int', so the <=3D 0 check didn't do what it's supposed to do anymore. With all the subsequent changes I'm not certain, however, that simply changing the variable declaration would be correct, thus it would be nice if whoever contributed the vector->irq conversion patch could double check that. Jan