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

[Xen-changelog] [xen stable-4.1] x86: irq_move_cleanup_interrupt() must ignore legacy vectors



commit d7d4d16afe2460a4e988ba237ec44c7fc36b7b1f
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Apr 9 16:10:29 2013 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Apr 9 16:10:29 2013 +0200

    x86: irq_move_cleanup_interrupt() must ignore legacy vectors
    
    Since the main loop in the function includes legacy vectors, and since
    vector_irq[] gets set up for legacy vectors regardless of whether those
    get handled through the IO-APIC, it must not do anything on this vector
    range. In fact, we should never get past the move_cleanup_count check
    for IRQs not handled through the IO-APIC. Adding a respective assertion
    woulkd make those iterations more expensive (due to the lock acquire).
    
    For such an assertion to not have false positives we however ought to
    suppress setting up IRQ2 as an 8259A interrupt (which wasn't correct
    anyway), which is being done here despite the assertion not actually
    getting added.
    
    Furthermore, there's no point iterating over the vectors past
    LAST_HIPRIORITY_VECTOR, so terminate the loop accordingly.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Keir Fraser <keir@xxxxxxx>
    master commit: af699220ad6d111ba76fc3040342184e423cc9a1
    master date: 2013-04-02 08:30:03 +0200
---
 xen/arch/x86/i8259.c   |    2 ++
 xen/arch/x86/io_apic.c |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index 47d7971..b8d535f 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -395,6 +395,8 @@ void __init init_IRQ(void)
         struct irq_desc *desc = irq_to_desc(irq);
         struct irq_cfg *cfg = desc->chip_data;
         
+        if ( irq == 2 ) /* IRQ2 doesn't exist */
+            continue;
         desc->handler = &i8259A_irq_type;
         per_cpu(vector_irq, cpu)[FIRST_LEGACY_VECTOR + irq] = irq;
         cfg->cpu_mask= cpumask_of_cpu(cpu);
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index fb762b8..4378d8e 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -499,7 +499,9 @@ fastcall void smp_irq_move_cleanup_interrupt(struct 
cpu_user_regs *regs)
     irq_enter();
 
     me = smp_processor_id();
-    for (vector = FIRST_DYNAMIC_VECTOR; vector < NR_VECTORS; vector++) {
+    for ( vector = FIRST_DYNAMIC_VECTOR;
+          vector <= LAST_HIPRIORITY_VECTOR; vector++)
+    {
         unsigned int irq;
         unsigned int irr;
         struct irq_desc *desc;
@@ -509,6 +511,9 @@ fastcall void smp_irq_move_cleanup_interrupt(struct 
cpu_user_regs *regs)
         if (irq == -1)
             continue;
 
+        if ( vector >= FIRST_LEGACY_VECTOR && vector <= LAST_LEGACY_VECTOR )
+            continue;
+
         desc = irq_to_desc(irq);
         if (!desc)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
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®.