Jan Beulich
2009-Feb-04 11:40 UTC
[Xen-devel] [PATCH] linux: fix IRQ handling for PV passthrough
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 <jbeulich@novell.com> --- 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 <linux/init.h> #include <linux/pci.h> #include <asm/acpi.h> +#include <xen/evtchn.h> #include "pci.h" 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 = irq; 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) != IRQT_UNBOUND) return; irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0); irq_desc[irq].chip = &pirq_type; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Isaku Yamahata
2009-Feb-12 06:29 UTC
Re: [Xen-devel] [PATCH] linux: fix IRQ handling for PV passthrough
On Wed, Feb 04, 2009 at 11:40:35AM +0000, Jan Beulich wrote:> 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.Thank you for taking care of IA64. evtchan_register_pirq() doesn''t have any effect on IA64 because identity_mapped_irq() is defined to 1. So IA64 is ok without any fix. Maybe in theory it should be called for consistency, though. thanks, -- yamahata _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel