ia64/xen-unstable

changeset 16161:bf3514726c1b

x86: Remove io_apic fake-vector style of IRQ acknowledgement. Not
needed now that pass-through IRQs can use the 'new' ack method.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Fri Oct 19 11:32:18 2007 +0100 (2007-10-19)
parents e733e6b73d56
children 6236adfbebe6
files xen/arch/x86/io_apic.c
line diff
     1.1 --- a/xen/arch/x86/io_apic.c	Fri Oct 19 11:26:58 2007 +0100
     1.2 +++ b/xen/arch/x86/io_apic.c	Fri Oct 19 11:32:18 2007 +0100
     1.3 @@ -184,68 +184,6 @@ static void __modify_IO_APIC_irq (unsign
     1.4      }
     1.5  }
     1.6  
     1.7 -static int real_vector[MAX_IRQ_SOURCES];
     1.8 -static int fake_vector=-1;
     1.9 -
    1.10 -/*
    1.11 - * Following 2 functions are used to workaround spurious interrupt
    1.12 - * problem related to mask/unmask of interrupts.  Instead we program
    1.13 - * an unused vector in the IOAPIC before issueing EOI to LAPIC.
    1.14 - */
    1.15 -static void write_fake_IO_APIC_vector (unsigned int irq)
    1.16 -{
    1.17 -    struct irq_pin_list *entry = irq_2_pin + irq;
    1.18 -    unsigned int pin, reg;
    1.19 -    unsigned long flags;
    1.20 -
    1.21 -    spin_lock_irqsave(&ioapic_lock, flags);
    1.22 -    for (;;) {
    1.23 -        pin = entry->pin;
    1.24 -        if (pin == -1)
    1.25 -            break;
    1.26 -        reg = io_apic_read(entry->apic, 0x10 + pin*2);
    1.27 -        real_vector[irq] = reg & 0xff;
    1.28 -        reg &= ~0xff;
    1.29 -
    1.30 -        if (fake_vector == -1)
    1.31 -            fake_vector = assign_irq_vector(MAX_IRQ_SOURCES-1);
    1.32 -
    1.33 -        reg |= fake_vector;
    1.34 -        io_apic_write(entry->apic, 0x10 + pin*2, reg);
    1.35 -
    1.36 -        if (!entry->next)
    1.37 -            break;
    1.38 -        entry = irq_2_pin + entry->next;
    1.39 -    }
    1.40 -    spin_unlock_irqrestore(&ioapic_lock, flags);
    1.41 -}
    1.42 -
    1.43 -static void restore_real_IO_APIC_vector (unsigned int irq)
    1.44 -{
    1.45 -    struct irq_pin_list *entry = irq_2_pin + irq;
    1.46 -    unsigned int pin, reg;
    1.47 -    unsigned long flags;
    1.48 -
    1.49 -    spin_lock_irqsave(&ioapic_lock, flags);
    1.50 -    for (;;) {
    1.51 -        pin = entry->pin;
    1.52 -        if (pin == -1)
    1.53 -            break;
    1.54 -
    1.55 -        reg = io_apic_read(entry->apic, 0x10 + pin*2);
    1.56 -        reg &= ~0xff;
    1.57 -        reg |= real_vector[irq];
    1.58 -        io_apic_write(entry->apic, 0x10 + pin*2, reg);
    1.59 -        mb();
    1.60 -        *(IO_APIC_BASE(entry->apic) + 0x10) = reg & 0xff;
    1.61 -
    1.62 -        if (!entry->next)
    1.63 -            break;
    1.64 -        entry = irq_2_pin + entry->next;
    1.65 -    }
    1.66 -    spin_unlock_irqrestore(&ioapic_lock, flags);
    1.67 -}
    1.68 -
    1.69  /* mask = 1 */
    1.70  static void __mask_IO_APIC_irq (unsigned int irq)
    1.71  {
    1.72 @@ -1418,10 +1356,7 @@ static void mask_and_ack_level_ioapic_ir
    1.73      if ( ioapic_ack_new )
    1.74          return;
    1.75  
    1.76 -    if ( vtd_enabled )
    1.77 -        write_fake_IO_APIC_vector(irq);
    1.78 -    else
    1.79 -        mask_IO_APIC_irq(irq);
    1.80 +    mask_IO_APIC_irq(irq);
    1.81  
    1.82  /*
    1.83   * It appears there is an erratum which affects at least version 0x11
    1.84 @@ -1464,12 +1399,8 @@ static void end_level_ioapic_irq (unsign
    1.85  
    1.86      if ( !ioapic_ack_new )
    1.87      {
    1.88 -        if ( !(irq_desc[IO_APIC_VECTOR(irq)].status & IRQ_DISABLED) ) {
    1.89 -            if ( vtd_enabled )
    1.90 -                restore_real_IO_APIC_vector(irq);
    1.91 -            else
    1.92 -                unmask_IO_APIC_irq(irq);
    1.93 -        }
    1.94 +        if ( !(irq_desc[IO_APIC_VECTOR(irq)].status & IRQ_DISABLED) )
    1.95 +            unmask_IO_APIC_irq(irq);
    1.96          return;
    1.97      }
    1.98