diff options
| -rw-r--r-- | arch/x86/kernel/kgdb.c | 4 | ||||
| -rw-r--r-- | arch/x86/kernel/traps_64.c | 7 | ||||
| -rw-r--r-- | kernel/kgdb.c | 14 |
3 files changed, 18 insertions, 7 deletions
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c index 7d651adcb222..8c7e555f6d39 100644 --- a/arch/x86/kernel/kgdb.c +++ b/arch/x86/kernel/kgdb.c | |||
| @@ -370,6 +370,8 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code, | |||
| 370 | ptr = &remcomInBuffer[1]; | 370 | ptr = &remcomInBuffer[1]; |
| 371 | if (kgdb_hex2long(&ptr, &addr)) | 371 | if (kgdb_hex2long(&ptr, &addr)) |
| 372 | linux_regs->ip = addr; | 372 | linux_regs->ip = addr; |
| 373 | case 'D': | ||
| 374 | case 'k': | ||
| 373 | newPC = linux_regs->ip; | 375 | newPC = linux_regs->ip; |
| 374 | 376 | ||
| 375 | /* clear the trace bit */ | 377 | /* clear the trace bit */ |
| @@ -480,6 +482,8 @@ static int __kgdb_notify(struct die_args *args, unsigned long cmd) | |||
| 480 | if (kgdb_handle_exception(args->trapnr, args->signr, args->err, regs)) | 482 | if (kgdb_handle_exception(args->trapnr, args->signr, args->err, regs)) |
| 481 | return NOTIFY_DONE; | 483 | return NOTIFY_DONE; |
| 482 | 484 | ||
| 485 | /* Must touch watchdog before return to normal operation */ | ||
| 486 | touch_nmi_watchdog(); | ||
| 483 | return NOTIFY_STOP; | 487 | return NOTIFY_STOP; |
| 484 | } | 488 | } |
| 485 | 489 | ||
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index 055b1650c69d..4e073320e70a 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c | |||
| @@ -600,8 +600,13 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
| 600 | 600 | ||
| 601 | void __kprobes die_nmi(char *str, struct pt_regs *regs, int do_panic) | 601 | void __kprobes die_nmi(char *str, struct pt_regs *regs, int do_panic) |
| 602 | { | 602 | { |
| 603 | unsigned long flags = oops_begin(); | 603 | unsigned long flags; |
| 604 | |||
| 605 | if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == | ||
| 606 | NOTIFY_STOP) | ||
| 607 | return; | ||
| 604 | 608 | ||
| 609 | flags = oops_begin(); | ||
| 605 | /* | 610 | /* |
| 606 | * We are in trouble anyway, lets at least try | 611 | * We are in trouble anyway, lets at least try |
| 607 | * to get a message out. | 612 | * to get a message out. |
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. |
