From: Tom Rotenberg Subject: Re: [PATCH] [IOEMU] Fix wrong INTx for pass-through device Date: Mon, 28 Dec 2009 16:33:51 +0200 Message-ID: <8686c3cd0912280633u27839f56k74abcd73fb041e4@mail.gmail.com> References: <4B38589B.8060307@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4B38589B.8060307@intel.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: "Zhai, Edwin" Cc: Simon Horman , Ian Jackson , Xen Developers List-Id: xen-devel@lists.xenproject.org Hi, I ran into similar problems last week, and i tried the following fix, which looks like it kind-of fixed it, does this do the same fix as your patch? Here is the patch i used: --- a/tools/ioemu/hw/pass-through.c Sun Dec 27 11:56:08 2009 +0200 +++ b/tools/ioemu/hw/pass-through.c Sun Dec 27 11:56:08 2009 +0200 @@ -4209,8 +4209,14 @@ */ uint8_t pci_intx(struct pt_dev *ptdev) { +#if 0 /* FIX */ if (!PCI_FUNC(ptdev->dev.devfn)) return 0; +#endif /* FIX */ + return pci_read_intx(ptdev); } Tom On Mon, Dec 28, 2009 at 9:04 AM, Zhai, Edwin wrote: > Simon, > For the pass-through device's INTx emulation, we follow the policy: if > virtual function 0, use INTA#, otherwise use hardware value. However, thi= s > policy only apply when bind_pt_pci_irq to xen, and always use physical va= lue > when exporting to guest. This discrepancy cause different INTx, thus > different GSI in xen and guest, so that interrupts never got injected to > guest. E.g. when assigning a USB controller with non-zero function(00:1d.= 2) > to guest as 00:4.0, xen will see INTA#, while guest see INTC#. > > This simple patch can fix it. Could you pls. review it? > > Thanks, > > -- > best rgds, > edwin > > > Signed-Off-By: Zhai Edwin > > diff --git a/hw/pass-through.c b/hw/pass-through.c > index e7bd386..a08c0bf 100644 > --- a/hw/pass-through.c > +++ b/hw/pass-through.c > @@ -2710,7 +2710,8 @@ static uint32_t pt_status_reg_init(struct pt_dev > *ptdev, > =A0static uint32_t pt_irqpin_reg_init(struct pt_dev *ptdev, > =A0 =A0 =A0 =A0 struct pt_reg_info_tbl *reg, uint32_t real_offset) > =A0{ > - =A0 =A0return ptdev->dev.config[real_offset]; > + =A0 =A0/* Translate xen INTx value to hw */ > + =A0 =A0return pci_intx(ptdev) + 1; > =A0} > > =A0/* initialize BAR */ > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > >