diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2008-03-07 17:34:16 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 14:05:40 -0400 |
commit | 737a460f21febe551ff1d2299b63bae9b154078f (patch) | |
tree | 7a2d9440222c22446e283f6fbc959b4a44270989 /kernel | |
parent | 84b5ae15216aa3ea0314f395536ef9829af21e14 (diff) |
kgdb: fix several kgdb regressions
kgdb core fixes:
- Check to see that mm->mmap_cache is not null before calling
flush_cache_range(), else on arch=ARM it will cause a fatal
fault.
- Breakpoints should only be restored if they are in the BP_ACTIVE
state.
- Fix a typo in comments to "kgdb_register_io_module"
x86 kgdb fixes:
- Fix the x86 arch handler such that on a kill or detach that the
appropriate cleanup on the single stepping flags gets run.
- Add in the DIE_NMIWATCHDOG call for x86_64
- Touch the nmi watchdog before returning the system to normal
operation after performing any kind of kgdb operation, else
the possibility exists to trigger the watchdog.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kgdb.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/kgdb.c b/kernel/kgdb.c index 31425e0fbf20..85b7e5b934a7 100644 --- a/kernel/kgdb.c +++ b/kernel/kgdb.c | |||
@@ -600,7 +600,7 @@ static void kgdb_flush_swbreak_addr(unsigned long addr) | |||
600 | if (!CACHE_FLUSH_IS_SAFE) | 600 | if (!CACHE_FLUSH_IS_SAFE) |
601 | return; | 601 | return; |
602 | 602 | ||
603 | if (current->mm) { | 603 | if (current->mm && current->mm->mmap_cache) { |
604 | flush_cache_range(current->mm->mmap_cache, | 604 | flush_cache_range(current->mm->mmap_cache, |
605 | addr, addr + BREAK_INSTR_SIZE); | 605 | addr, addr + BREAK_INSTR_SIZE); |
606 | } else { | 606 | } else { |
@@ -729,14 +729,16 @@ int remove_all_break(void) | |||
729 | 729 | ||
730 | /* Clear memory breakpoints. */ | 730 | /* Clear memory breakpoints. */ |
731 | for (i = 0; i < KGDB_MAX_BREAKPOINTS; i++) { | 731 | for (i = 0; i < KGDB_MAX_BREAKPOINTS; i++) { |
732 | if (kgdb_break[i].state != BP_SET) | 732 | if (kgdb_break[i].state != BP_ACTIVE) |
733 | continue; | 733 | goto setundefined; |
734 | addr = kgdb_break[i].bpt_addr; | 734 | addr = kgdb_break[i].bpt_addr; |
735 | error = kgdb_arch_remove_breakpoint(addr, | 735 | error = kgdb_arch_remove_breakpoint(addr, |
736 | kgdb_break[i].saved_instr); | 736 | kgdb_break[i].saved_instr); |
737 | if (error) | 737 | if (error) |
738 | return error; | 738 | printk(KERN_ERR "KGDB: breakpoint remove failed: %lx\n", |
739 | kgdb_break[i].state = BP_REMOVED; | 739 | addr); |
740 | setundefined: | ||
741 | kgdb_break[i].state = BP_UNDEFINED; | ||
740 | } | 742 | } |
741 | 743 | ||
742 | /* Clear hardware breakpoints. */ | 744 | /* Clear hardware breakpoints. */ |
@@ -1605,7 +1607,7 @@ static void kgdb_initial_breakpoint(void) | |||
1605 | } | 1607 | } |
1606 | 1608 | ||
1607 | /** | 1609 | /** |
1608 | * kkgdb_register_io_module - register KGDB IO module | 1610 | * kgdb_register_io_module - register KGDB IO module |
1609 | * @new_kgdb_io_ops: the io ops vector | 1611 | * @new_kgdb_io_ops: the io ops vector |
1610 | * | 1612 | * |
1611 | * Register it with the KGDB core. | 1613 | * Register it with the KGDB core. |