From: Keir Fraser Date: Fri, 19 Oct 2007 10:32:18 +0000 (+0100) Subject: x86: Remove io_apic fake-vector style of IRQ acknowledgement. Not X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14847^2~15 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e8676312a304ca702ae3f8e9e95fbd5d022b89d5;p=xen.git 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 --- diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 7b399850ce..9ccbefd22a 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -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; }