Commit f2cee0af authored by James Cleverdon's avatar James Cleverdon Committed by Linus Torvalds

[PATCH] Allow more APIC irq sources

The "irq_vector[]" array is indexed by the sum of all RTEs in all I/O
APICs, and is not necessarily limited by the x86 CPU irq vector inputs.

In fact, the irq vector index would overflow on big machines with lots
of IO APIC's, causing the boot to fail.

So grow the array for the big SMP boxes, keeping the default the same as
before (and shrink the vector entry size down to a 8-bit value, since
that's the size of the actual CPU vector entry).
parent dc84a4e4
...@@ -1138,12 +1138,13 @@ static inline int IO_APIC_irq_trigger(int irq) ...@@ -1138,12 +1138,13 @@ static inline int IO_APIC_irq_trigger(int irq)
return 0; return 0;
} }
int irq_vector[NR_IRQS] = { FIRST_DEVICE_VECTOR , 0 }; /* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */
u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 };
static int __init assign_irq_vector(int irq) static int __init assign_irq_vector(int irq)
{ {
static int current_vector = FIRST_DEVICE_VECTOR, offset = 0; static int current_vector = FIRST_DEVICE_VECTOR, offset = 0;
BUG_ON(irq >= NR_IRQS); BUG_ON(irq >= NR_IRQ_VECTORS);
if (IO_APIC_VECTOR(irq) > 0) if (IO_APIC_VECTOR(irq) > 0)
return IO_APIC_VECTOR(irq); return IO_APIC_VECTOR(irq);
next: next:
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
* Interrupt entry/exit code at both C and assembly level * Interrupt entry/exit code at both C and assembly level
*/ */
extern int irq_vector[NR_IRQS]; extern u8 irq_vector[NR_IRQ_VECTORS];
#define IO_APIC_VECTOR(irq) irq_vector[irq] #define IO_APIC_VECTOR(irq) ((int)irq_vector[irq])
extern void (*interrupt[NR_IRQS])(void); extern void (*interrupt[NR_IRQS])(void);
......
...@@ -78,8 +78,14 @@ ...@@ -78,8 +78,14 @@
*/ */
#ifdef CONFIG_X86_IO_APIC #ifdef CONFIG_X86_IO_APIC
#define NR_IRQS 224 #define NR_IRQS 224
# if (224 >= 32 * NR_CPUS)
# define NR_IRQ_VECTORS NR_IRQS
# else
# define NR_IRQ_VECTORS (32 * NR_CPUS)
# endif
#else #else
#define NR_IRQS 16 #define NR_IRQS 16
#define NR_IRQ_VECTORS NR_IRQS
#endif #endif
#define FPU_IRQ 13 #define FPU_IRQ 13
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment