linux: fix IRQ handling for PV passthrough
PATCH 1/1 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.
arch/i386/pci/pcifront.c +2 -0
@@ -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 ;
drivers/xen/core/evtchn.c +1 -1
@@ -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;
Quoted 9 lines · Jan Beulich
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,
Signature · 1 line
yamahata