0e39189
0e39189
# HG changeset patch
0e39189
# User Keir Fraser <keir@xen.org>
0e39189
# Date 1286028622 -3600
0e39189
# Node ID f7d54e1d7044a7d3836b017b0806021b1c17ac7a
0e39189
# Parent 7f190f6f1f5a861383fc1a3a877ab63841c00a15
0e39189
x86: fix boot failure (regression from pre-4.0 IRQ handling changes)
0e39189
0e39189
With the change to index irq_desc[] by IRQ rather than by vector, the
0e39189
prior implicit change of the used flow handler when altering the IRQ
0e39189
routing path to go through the 8259A didn't work anymore, and hence
0e39189
on boards needing the ExtINT delivery workaround failed to boot.
0e39189
0e39189
Make make_8259A_irq() a real function again, thus allowing the flow
0e39189
handler to be changed there.
0e39189
0e39189
Also eliminate the generally superfluous and (at least theoretically)
0e39189
dangerous hard coded setting of the flow handler for IRQ0: Earlier
0e39189
code should have set this already based on information coming from
0e39189
ACPI/MPS, and non-standard systems may e.g. have this IRQ level
0e39189
triggered.
0e39189
0e39189
Signed-off-by: Jan Beulich <jbeulich@novell.com>
0e39189
Tested-by: Markus Schuster <ml@markus.schuster.name>
0e39189
xen-unstable changeset:   22222:aed9fd361340
0e39189
xen-unstable date:        Sat Oct 02 15:03:15 2010 +0100
0e39189
0e39189
--- a/xen/arch/x86/i8259.c	Sat Oct 02 15:10:01 2010 +0100
0e39189
+++ b/xen/arch/x86/i8259.c	Sat Oct 02 15:10:22 2010 +0100
0e39189
@@ -367,6 +367,12 @@ void __devinit init_8259A(int auto_eoi)
0e39189
     spin_unlock_irqrestore(&i8259A_lock, flags);
0e39189
 }
0e39189
 
0e39189
+void __init make_8259A_irq(unsigned int irq)
0e39189
+{
0e39189
+    io_apic_irqs &= ~(1 << irq);
0e39189
+    irq_to_desc(irq)->handler = &i8259A_irq_type;
0e39189
+}
0e39189
+
0e39189
 static struct irqaction __read_mostly cascade = { no_action, "cascade", NULL};
0e39189
 
0e39189
 void __init init_IRQ(void)
0e39189
--- a/xen/arch/x86/io_apic.c	Sat Oct 02 15:10:01 2010 +0100
0e39189
+++ b/xen/arch/x86/io_apic.c	Sat Oct 02 15:10:22 2010 +0100
0e39189
@@ -37,9 +37,6 @@
0e39189
 #include <mach_apic.h>
0e39189
 #include <io_ports.h>
0e39189
 #include <public/physdev.h>
0e39189
-
0e39189
-/* Different to Linux: our implementation can be simpler. */
0e39189
-#define make_8259A_irq(irq) (io_apic_irqs &= ~(1<<(irq)))
0e39189
 
0e39189
 int (*ioapic_renumber_irq)(int ioapic, int irq);
0e39189
 atomic_t irq_mis_count;
0e39189
@@ -1929,7 +1926,6 @@ static inline void check_timer(void)
0e39189
     
0e39189
     irq_desc[0].depth  = 0;
0e39189
     irq_desc[0].status &= ~IRQ_DISABLED;
0e39189
-    irq_desc[0].handler = &ioapic_edge_type;
0e39189
 
0e39189
     /*
0e39189
      * Subtle, code in do_timer_interrupt() expects an AEOI
0e39189
--- a/xen/include/asm-x86/irq.h	Sat Oct 02 15:10:01 2010 +0100
0e39189
+++ b/xen/include/asm-x86/irq.h	Sat Oct 02 15:10:22 2010 +0100
0e39189
@@ -94,6 +94,7 @@ void mask_8259A(void);
0e39189
 void mask_8259A(void);
0e39189
 void unmask_8259A(void);
0e39189
 void init_8259A(int aeoi);
0e39189
+void make_8259A_irq(unsigned int irq);
0e39189
 int i8259A_suspend(void);
0e39189
 int i8259A_resume(void);
0e39189
 
0e39189