[Top] [All Lists]

A patch for the conflict of the irq vector "KDBENTER_VECTOR"

To: kdb@xxxxxxxxxxx
Subject: A patch for the conflict of the irq vector "KDBENTER_VECTOR"
From: "Zhang, Sonic" <sonic.zhang@xxxxxxxxx>
Date: Thu, 21 Nov 2002 14:32:25 +0800
Sender: kdb-bounce@xxxxxxxxxxx
Hi all,

        There may be a bug related to the irq vector "KDBENTER_VECTOR" in
KDB on platform i386.

        KDB uses 0x81 as its irq vector, but this vector isn't reserved in
advance by KDB. Routine "setup_IO_APIC_irqs(..) " in the file
"arch/i386/kernel/io_apic.c" sets a gate entry with the same vector as KDB,
which overrides the original 0x81 entry set by KDB. So we fail to enter KDB
through irq vector 0x81 after the OS finish the SMP initianlization. 

        The code lines are as follows:

        if (IO_APIC_IRQ(irq)) {
                vector = assign_irq_vector(irq);
                entry.vector = vector;

                if (IO_APIC_irq_trigger(irq))
                        irq_desc[irq].handler = &ioapic_level_irq_type;
                        irq_desc[irq].handler = &ioapic_edge_irq_type;

                set_intr_gate(vector, interrupt[irq]);
                if (!apic && (irq < 16))

        The vector is assigned in routine "assign_irq_vector(...)". We need
to change this routine to avoid conflict. I think we can solve this problem
by following patch.

--- linux/arch/i386/kernel/io_apic.c    Sun Nov 17 23:08:21 2002
+++ linux-kdb/arch/i386/kernel/io_apic.c        Sun Nov 17 23:06:51 2002
@@ -646,6 +646,11 @@
        if (current_vector == SYSCALL_VECTOR)
                goto next;
+#ifdef CONFIG_KDB
+       if (current_vector == KDBENTER_VECTOR)
+               goto next;
        if (current_vector > FIRST_SYSTEM_VECTOR) {
                current_vector = FIRST_DEVICE_VECTOR + offset;

        Do you think it's a reasonalble resolution?

    Sonic Zhang
This email message solely contains my own personal views and not necessarily
those of my employer.

<Prev in Thread] Current Thread [Next in Thread>