kdb
[Top] [All Lists]

A small fix.

To: kdb@xxxxxxxxxxx, Michael Hohnbaum <hbaum@xxxxxxxxxx>, Patricia Gaughen <gone@xxxxxxxxxx>
Subject: A small fix.
From: Matthew Dobson <colpatch@xxxxxxxxxx>
Date: Tue, 25 Jun 2002 17:24:00 -0700
Organization: IBM LTC
Reply-to: colpatch@xxxxxxxxxx
Sender: owner-kdb@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020607
This patch gets stack backtracing to work, and also allows CPU switching on our NUMA-Q hardware. Pat Gaughen and I had posted here a little while ago about the problems we were experiencing with KDB. This patch fixes them for me, so if anyone else can verify that they work smoothly for you too, that'd be great!

Cheers!

-Matt
diff -Nur linux-2.5.9-van+kdb/arch/i386/kdb/kdba_bt.c 
linux-2.5.9-kdb/arch/i386/kdb/kdba_bt.c
--- linux-2.5.9-van+kdb/arch/i386/kdb/kdba_bt.c Mon Jun 24 11:33:52 2002
+++ linux-2.5.9-kdb/arch/i386/kdb/kdba_bt.c     Fri Jun  7 10:58:32 2002
@@ -335,9 +335,9 @@
 
        taskregs.xcs  = __KERNEL_CS;    /* have to assume kernel space */
 
-       if (taskregs.esp < (unsigned long)p ||
-           taskregs.esp >= (unsigned long)p + 8192) {
-               kdb_printf("Stack is not in task_struct, backtrace not 
available\n");
+       if (taskregs.esp < (unsigned long)p->thread_info ||
+           taskregs.esp >= (unsigned long)p->thread_info + 8192) {
+               kdb_printf("Stack is not in task_struct->thread_info, backtrace 
not available\n");
                return(0);
        }
 
diff -Nur linux-2.5.9-van+kdb/arch/i386/kernel/smp.c 
linux-2.5.9-kdb/arch/i386/kernel/smp.c
--- linux-2.5.9-van+kdb/arch/i386/kernel/smp.c  Mon Jun 24 11:33:51 2002
+++ linux-2.5.9-kdb/arch/i386/kernel/smp.c      Tue Jun 11 13:59:47 2002
@@ -236,7 +237,15 @@
                         * program the ICR 
                         */
                        cfg = __prepare_ICR(0, vector);
-                       
+
+#ifdef CONFIG_KDB
+       if (vector == KDB_VECTOR) {
+               /*
+                * Setup KDB IPI to be delivered as an NMI
+                */
+               cfg = (cfg&~APIC_VECTOR_MASK)|APIC_DM_NMI;
+       }
+#endif /* CONFIG_KDB */
                        /*
                         * Send the IPI. The write to APIC_ICR fires this off.
                         */
<Prev in Thread] Current Thread [Next in Thread>