x86: Remove io_apic fake-vector style of IRQ acknowledgement. Not
authorKeir Fraser <keir@xensource.com>
Fri, 19 Oct 2007 10:32:18 +0000 (11:32 +0100)
committerKeir Fraser <keir@xensource.com>
Fri, 19 Oct 2007 10:32:18 +0000 (11:32 +0100)
needed now that pass-through IRQs can use the 'new' ack method.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/io_apic.c

index 7b399850ce06764a478fc5876a182970ad0cdbe4..9ccbefd22a016fcf0af716c31aa06752b6e58e38 100644 (file)
@@ -184,68 +184,6 @@ static void __modify_IO_APIC_irq (unsigned int irq, unsigned long enable, unsign
     }
 }
 
-static int real_vector[MAX_IRQ_SOURCES];
-static int fake_vector=-1;
-
-/*
- * Following 2 functions are used to workaround spurious interrupt
- * problem related to mask/unmask of interrupts.  Instead we program
- * an unused vector in the IOAPIC before issueing EOI to LAPIC.
- */
-static void write_fake_IO_APIC_vector (unsigned int irq)
-{
-    struct irq_pin_list *entry = irq_2_pin + irq;
-    unsigned int pin, reg;
-    unsigned long flags;
-
-    spin_lock_irqsave(&ioapic_lock, flags);
-    for (;;) {
-        pin = entry->pin;
-        if (pin == -1)
-            break;
-        reg = io_apic_read(entry->apic, 0x10 + pin*2);
-        real_vector[irq] = reg & 0xff;
-        reg &= ~0xff;
-
-        if (fake_vector == -1)
-            fake_vector = assign_irq_vector(MAX_IRQ_SOURCES-1);
-
-        reg |= fake_vector;
-        io_apic_write(entry->apic, 0x10 + pin*2, reg);
-
-        if (!entry->next)
-            break;
-        entry = irq_2_pin + entry->next;
-    }
-    spin_unlock_irqrestore(&ioapic_lock, flags);
-}
-
-static void restore_real_IO_APIC_vector (unsigned int irq)
-{
-    struct irq_pin_list *entry = irq_2_pin + irq;
-    unsigned int pin, reg;
-    unsigned long flags;
-
-    spin_lock_irqsave(&ioapic_lock, flags);
-    for (;;) {
-        pin = entry->pin;
-        if (pin == -1)
-            break;
-
-        reg = io_apic_read(entry->apic, 0x10 + pin*2);
-        reg &= ~0xff;
-        reg |= real_vector[irq];
-        io_apic_write(entry->apic, 0x10 + pin*2, reg);
-        mb();
-        *(IO_APIC_BASE(entry->apic) + 0x10) = reg & 0xff;
-
-        if (!entry->next)
-            break;
-        entry = irq_2_pin + entry->next;
-    }
-    spin_unlock_irqrestore(&ioapic_lock, flags);
-}
-
 /* mask = 1 */
 static void __mask_IO_APIC_irq (unsigned int irq)
 {
@@ -1418,10 +1356,7 @@ static void mask_and_ack_level_ioapic_irq (unsigned int irq)
     if ( ioapic_ack_new )
         return;
 
-    if ( vtd_enabled )
-        write_fake_IO_APIC_vector(irq);
-    else
-        mask_IO_APIC_irq(irq);
+    mask_IO_APIC_irq(irq);
 
 /*
  * It appears there is an erratum which affects at least version 0x11
@@ -1464,12 +1399,8 @@ static void end_level_ioapic_irq (unsigned int irq)
 
     if ( !ioapic_ack_new )
     {
-        if ( !(irq_desc[IO_APIC_VECTOR(irq)].status & IRQ_DISABLED) ) {
-            if ( vtd_enabled )
-                restore_real_IO_APIC_vector(irq);
-            else
-                unmask_IO_APIC_irq(irq);
-        }
+        if ( !(irq_desc[IO_APIC_VECTOR(irq)].status & IRQ_DISABLED) )
+            unmask_IO_APIC_irq(irq);
         return;
     }