From: "Jan Beulich" Subject: [PATCH] linux: fix IRQ handling for PV passthrough Date: Wed, 04 Feb 2009 11:40:35 +0000 Message-ID: <49898CC3.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: 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: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org For DomU-s registering PIRQ-s must be done separately, as they don't use the IO-APIC code. Additionally make sure the IRQ chip doesn't get set twice (and the event channel information overwritten) for an IRQ possibly in use by more than one device. Obviously IA64 would need a similar fix, but I can't see where it would need to be put. As usual, written and tested on 2.6.27.x and made apply to the 2.6.18 tree without further testing. Signed-off-by: Jan Beulich --- a/arch/i386/pci/pcifront.c 2009-02-03 17:27:59.000000000 +0100 +++ b/arch/i386/pci/pcifront.c 2009-02-03 11:22:28.000000000 +0100 @@ -8,12 +8,14 @@ #include #include #include +#include #include "pci.h" =20 static int pcifront_enable_irq(struct pci_dev *dev) { u8 irq; pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); + evtchn_register_pirq(irq); dev->irq =3D irq; =20 return 0; --- a/drivers/xen/core/evtchn.c 2009-01-14 15:16:43.000000000 +0100 +++ b/drivers/xen/core/evtchn.c 2009-02-03 17:34:44.000000000 +0100 @@ -1091,7 +1091,7 @@ core_initcall(evtchn_register); void evtchn_register_pirq(int irq) { BUG_ON(irq < PIRQ_BASE || irq - PIRQ_BASE > NR_PIRQS); - if (identity_mapped_irq(irq)) + if (identity_mapped_irq(irq) || type_from_irq(irq) !=3D IRQT_UNBOUN= D) return; irq_info[irq] =3D mk_irq_info(IRQT_PIRQ, irq, 0); irq_desc[irq].chip =3D &pirq_type;