From: "Jan Beulich" Subject: Re: [PATCH] Dont call msi_unmap_pirq() if did not enabled msi Date: Tue, 17 Nov 2009 11:21:12 +0000 Message-ID: <4B0295380200007800020165@vpn.id2.novell.com> References: <20091116120030.GA13803@joejin-pc.cn.oracle.com> <20091116151546.GC30967@phenom.dumpdata.com> <20091117001909.GA18296@joejin-pc.cn.oracle.com> <4B0265DA02000078000200FF@vpn.id2.novell.com> <20091117101416.GA23253@joejin-pc.cn.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20091117101416.GA23253@joejin-pc.cn.oracle.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: Joe Jin Cc: Xen-devel , Konrad Rzeszutek Wilk , Kurt Hackel , Yunhong Jiang , Haitao Shan , greg.marsden@oracle.com, Jerry Yuanjiang Ou , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> Joe Jin 17.11.09 11:14 >>> >On 2009-11-17 07:59, Jan Beulich wrote: >> >>> Joe Jin 17.11.09 01:19 >>> >> >--- a/drivers/pci/msi-xen.c Fri Oct 23 10:07:22 2009 +0100 >> >+++ b/drivers/pci/msi-xen.c Tue Nov 17 08:16:42 2009 +0800 >> >@@ -673,6 +673,12 @@ >> > if (!pos) >> > return; >> >=20 >> >+ if (!(dev->msi_enabled)) { >> >+ printk(KERN_INFO "PCI: %s: Device did not enabled MSI.\n", >> >+ pci_name(dev)); >> >+ return; >> >+ } >> >+=20 >> > pirq =3D dev->irq; >> > /* Restore dev->irq to its default pin-assertion vector */ >> > dev->irq =3D msi_dev_entry->default_irq; >>=20 >> But shouldn't this happen before the CONFIG_XEN_PCIDEV_FRONTEND >> conditional block? This one also calls evtchn_map_pirq(..., 0), i.e. = would >> also result in the storing of no_irq_chip. > >However when irq_desc[irq]->chip set to no_irq_chip, if any device try to = request >the @irq will failed and return -ENOSYS via request_irq()->setup_irq(). > >According to codes, only when CONFIG_XEN_PCIDEV_FRONTEND and !is_initial_x= endomain(), >it will called evtchn_map_pirq(), meant only guest OS may call it, Dom0 = will not. >But during pci_enable_msi(), it never set the flag(dev->msi_enabled), I'm = not sure if >Guest OS will set it if enabled msi, any suggestion? Hmm, indeed - I'm not sure then. Clarification from the Intel guys having originally written this code would be very desirable here; adding them to Cc. Jan