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.
*/
|