[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [linux-2.6.18-xen] x86/evtchn: make use of PHYSDEVOP_map_pirq
# HG changeset patch # User Jan Beulich <jbeulich@xxxxxxxx> # Date 1445003840 -7200 # Node ID 3f51e783c26a52086fb349313fad1758e4e35297 # Parent 47161cb7bd45c059b8e75c09d59ee1124953ad46 x86/evtchn: make use of PHYSDEVOP_map_pirq Xen commit 669d4b85c4 ("x86/IO-APIC: don't create pIRQ mapping from masked RTE") revealed that for any interrupts which get set up masked (commonly at least level triggered ones), the pIRQ <-> IRQ mapping never gets established (since the IO-APIC RTE writes now don't have that effect anymore when the mask bit is set), resulting in subsequent binding of the pIRQ to fail. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- diff -r 47161cb7bd45 -r 3f51e783c26a drivers/xen/core/evtchn.c --- a/drivers/xen/core/evtchn.c Mon Sep 28 10:38:54 2015 +0200 +++ b/drivers/xen/core/evtchn.c Fri Oct 16 15:57:20 2015 +0200 @@ -1113,13 +1113,34 @@ void irq_resume(void) #define identity_mapped_irq(irq) (1) #endif -void evtchn_register_pirq(int irq) +int evtchn_register_pirq(int irq) { + struct physdev_map_pirq map_pirq = { + .domid = DOMID_SELF, + .type = MAP_PIRQ_TYPE_GSI, + .index = irq, + .pirq = irq + }; + BUG_ON(irq < PIRQ_BASE || irq - PIRQ_BASE >= NR_PIRQS); - 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; + + switch (type_from_irq(irq)) { + case IRQT_UNBOUND: + break; + case IRQT_PIRQ: + if (index_from_irq(irq) == irq) + return -EEXIST; + default: + return -EBUSY; + } + + if (!identity_mapped_irq(irq)) { + irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, 0); + irq_desc[irq].chip = &pirq_type; + } + + return is_initial_xendomain() + ? HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_pirq) : 0; } int evtchn_map_pirq(int irq, int xen_pirq) diff -r 47161cb7bd45 -r 3f51e783c26a include/xen/evtchn.h --- a/include/xen/evtchn.h Mon Sep 28 10:38:54 2015 +0200 +++ b/include/xen/evtchn.h Fri Oct 16 15:57:20 2015 +0200 @@ -102,7 +102,7 @@ asmlinkage void evtchn_do_upcall(struct void evtchn_device_upcall(int port); /* Mark a PIRQ as unavailable for dynamic allocation. */ -void evtchn_register_pirq(int irq); +int evtchn_register_pirq(int irq); /* Map a Xen-supplied PIRQ to a dynamically allocated one. */ int evtchn_map_pirq(int irq, int xen_pirq); /* Look up a Xen-supplied PIRQ for a dynamically allocated one. */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |