[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/IO-APIC: fix setup of Xen internally used IRQs



commit 1126b40892ab56cb13c3cae5822bf3a18a689ffb
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Nov 12 17:04:10 2015 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Nov 12 17:04:10 2015 +0100

    x86/IO-APIC: fix setup of Xen internally used IRQs
    
    ..., i.e. namely that of a PCI serial card with an IRQ above the
    legacy range. This had got broken by the switch to cpumask_any() in
    cpu_mask_to_apicid_phys(). Fix this by allowing all CPUs for that IRQ
    (such that __setup_vector_irq() will properly update a booting CPU's
    vector_irq[], avoiding "No irq handler for vector" messages and the
    interrupt not working).
    
    While doing this I also noticed that io_apic_set_pci_routing() can't
    be quite right: It sets up the destination _before_ getting a vector
    allocated (which on other than systems using the flat APIC mode
    affects the possible destinations), and also didn't restrict affinity
    to ->arch.cpu_mask (as established by assign_irq_vector()).
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/io_apic.c |    7 +++++--
 xen/arch/x86/smpboot.c |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 1e710d6..f5b8d7d 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -2201,6 +2201,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int 
irq, int edge_level, int a
 {
     struct irq_desc *desc = irq_to_desc(irq);
     struct IO_APIC_route_entry entry;
+    cpumask_t mask;
     unsigned long flags;
     int vector;
 
@@ -2220,8 +2221,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int 
irq, int edge_level, int a
 
     entry.delivery_mode = INT_DELIVERY_MODE;
     entry.dest_mode = INT_DEST_MODE;
-    SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
-        cpu_mask_to_apicid(TARGET_CPUS));
     entry.trigger = edge_level;
     entry.polarity = active_high_low;
     entry.mask  = 1;
@@ -2237,6 +2236,10 @@ int io_apic_set_pci_routing (int ioapic, int pin, int 
irq, int edge_level, int a
         return vector;
     entry.vector = vector;
 
+    cpumask_and(&mask, desc->arch.cpu_mask, TARGET_CPUS);
+    SET_DEST(entry.dest.dest32, entry.dest.logical.logical_dest,
+             cpu_mask_to_apicid(&mask));
+
     apic_printk(APIC_DEBUG, KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry "
                "(%d-%d -> %#x -> IRQ %d Mode:%i Active:%i)\n", ioapic,
                mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index dabc929..1d884af 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -1084,7 +1084,7 @@ void __init smp_intr_init(void)
         vector = alloc_hipriority_vector();
         per_cpu(vector_irq, cpu)[vector] = irq;
         irq_to_desc(irq)->arch.vector = vector;
-        cpumask_copy(irq_to_desc(irq)->arch.cpu_mask, &cpu_online_map);
+        cpumask_setall(irq_to_desc(irq)->arch.cpu_mask);
     }
 
     /* Direct IPI vectors. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.