diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index fff59019cca014cb58284120471a9c2cd4c36ed2..b38bb25dbbb3467ccfa8d4acdf3b53b003bf4e8d 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -445,6 +445,10 @@ static int kgdb_reenter_check(struct kgdb_state *ks) } printk(KERN_CRIT "KGDB: re-enter exception: ALL breakpoints killed\n"); +#ifdef CONFIG_KGDB_KDB + /* Allow kdb to debug itself one level */ + return 0; +#endif dump_stack(); panic("Recursive entry to debugger"); @@ -489,6 +493,9 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) */ atomic_inc(&cpu_in_kgdb[cpu]); + if (exception_level == 1) + goto cpu_master_loop; + /* * CPU will loop if it is a slave or request to become a kgdb * master cpu and acquire the kgdb_active lock: