Skip to content

Commit 6d90634

Browse files
committed
debug_core,kdb: Allow the debug core to process a recursive debug entry
This allows kdb to debug a crash with in the kms code with a single level recursive re-entry. Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
1 parent d37d39a commit 6d90634

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

kernel/debug/debug_core.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,10 @@ static int kgdb_reenter_check(struct kgdb_state *ks)
445445
}
446446

447447
printk(KERN_CRIT "KGDB: re-enter exception: ALL breakpoints killed\n");
448+
#ifdef CONFIG_KGDB_KDB
449+
/* Allow kdb to debug itself one level */
450+
return 0;
451+
#endif
448452
dump_stack();
449453
panic("Recursive entry to debugger");
450454

@@ -489,6 +493,9 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
489493
*/
490494
atomic_inc(&cpu_in_kgdb[cpu]);
491495

496+
if (exception_level == 1)
497+
goto cpu_master_loop;
498+
492499
/*
493500
* CPU will loop if it is a slave or request to become a kgdb
494501
* master cpu and acquire the kgdb_active lock:

0 commit comments

Comments
 (0)