Re: kernel BUG at arch/x86/kernel/io_apic_64.c:357!

From: Yinghai Lu
Date: Tue Jul 29 2008 - 15:20:17 EST


On Tue, Jul 29, 2008 at 11:35 AM, Yinghai Lu <yhlu.kernel@xxxxxxxxx> wrote:
> On Tue, Jul 29, 2008 at 9:09 AM, Dhaval Giani <dhaval@xxxxxxxxxxxxxxxxxx> wrote:
>> Hi Ingo, Thomas,
>>
>> Hit this on 2.6.27-rc1
>>
>> (The kernel bug is at line 356 (Its 357 as I applied a debug patch to
>> print out the irq) (Full dmesg and .config attached)
>
> can you boot with "debug apic=verbose pci=routeirq"?

please try attached patch

YH
[PATCH] x86: 64bit support more than 256 irq

because 64bit allow same vector for different cpu to serve different irq

also change next in irq_pin_list from short to next. because for 4096 NR_IRQS
is 2^(5+12)+224.

need to create that array dynamically later

Signed-off-by: Yinghai Lu <yhlu.kernel@xxxxxxxxx>

---
arch/x86/kernel/io_apic_64.c | 3 ++-
include/asm-x86/irq_vectors.h | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)

Index: linux-2.6/include/asm-x86/irq_vectors.h
===================================================================
--- linux-2.6.orig/include/asm-x86/irq_vectors.h
+++ linux-2.6/include/asm-x86/irq_vectors.h
@@ -113,9 +113,13 @@

# if defined(CONFIG_X86_IO_APIC) || defined(CONFIG_PARAVIRT) || defined(CONFIG_X86_VISWS)

+#ifdef CONFIG_X86_64
+# define NR_IRQS (32 * NR_CPUS + 224)
+#else
# define NR_IRQS 224
+#endif

-# if (224 >= 32 * NR_CPUS)
+# if (NR_IRQS >= 32 * NR_CPUS)
# define NR_IRQ_VECTORS NR_IRQS
# else
# define NR_IRQ_VECTORS (32 * NR_CPUS)
Index: linux-2.6/arch/x86/kernel/io_apic_64.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/io_apic_64.c
+++ linux-2.6/arch/x86/kernel/io_apic_64.c
@@ -140,7 +140,8 @@ DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BU
*/

static struct irq_pin_list {
- short apic, pin, next;
+ short apic, pin;
+ int next;
} irq_2_pin[PIN_MAP_SIZE];

struct io_apic {