aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/kernel/traps.c14
-rw-r--r--include/asm-x86_64/kdebug.h1
2 files changed, 3 insertions, 12 deletions
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 2f42fd5c075f..f6ccf155e3e5 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -659,9 +659,9 @@ asmlinkage void do_debug(struct pt_regs * regs, unsigned long error_code)
659 asm("movq %%db6,%0" : "=r" (condition)); 659 asm("movq %%db6,%0" : "=r" (condition));
660 660
661 if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code, 661 if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
662 SIGTRAP) == NOTIFY_STOP) { 662 SIGTRAP) == NOTIFY_STOP)
663 return; 663 return;
664 } 664
665 conditional_sti(regs); 665 conditional_sti(regs);
666 666
667 /* Mask out spurious debug traps due to lazy DR7 setting */ 667 /* Mask out spurious debug traps due to lazy DR7 setting */
@@ -674,9 +674,7 @@ asmlinkage void do_debug(struct pt_regs * regs, unsigned long error_code)
674 tsk->thread.debugreg6 = condition; 674 tsk->thread.debugreg6 = condition;
675 675
676 /* Mask out spurious TF errors due to lazy TF clearing */ 676 /* Mask out spurious TF errors due to lazy TF clearing */
677 if ((condition & DR_STEP) && 677 if (condition & DR_STEP) {
678 (notify_die(DIE_DEBUGSTEP, "debugstep", regs, condition,
679 1, SIGTRAP) != NOTIFY_STOP)) {
680 /* 678 /*
681 * The TF error should be masked out only if the current 679 * The TF error should be masked out only if the current
682 * process is not traced and if the TRAP flag has been set 680 * process is not traced and if the TRAP flag has been set
@@ -711,16 +709,10 @@ asmlinkage void do_debug(struct pt_regs * regs, unsigned long error_code)
711 force_sig_info(SIGTRAP, &info, tsk); 709 force_sig_info(SIGTRAP, &info, tsk);
712clear_dr7: 710clear_dr7:
713 asm volatile("movq %0,%%db7"::"r"(0UL)); 711 asm volatile("movq %0,%%db7"::"r"(0UL));
714 notify_die(DIE_DEBUG, "debug", regs, condition, 1, SIGTRAP);
715 return; 712 return;
716 713
717clear_TF_reenable: 714clear_TF_reenable:
718 set_tsk_thread_flag(tsk, TIF_SINGLESTEP); 715 set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
719
720clear_TF:
721 /* RED-PEN could cause spurious errors */
722 if (notify_die(DIE_DEBUG, "debug2", regs, condition, 1, SIGTRAP)
723 != NOTIFY_STOP)
724 regs->eflags &= ~TF_MASK; 716 regs->eflags &= ~TF_MASK;
725} 717}
726 718
diff --git a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h
index adb6f918d3ad..6277f75cbb4b 100644
--- a/include/asm-x86_64/kdebug.h
+++ b/include/asm-x86_64/kdebug.h
@@ -23,7 +23,6 @@ enum die_val {
23 DIE_OOPS = 1, 23 DIE_OOPS = 1,
24 DIE_INT3, 24 DIE_INT3,
25 DIE_DEBUG, 25 DIE_DEBUG,
26 DIE_DEBUGSTEP,
27 DIE_PANIC, 26 DIE_PANIC,
28 DIE_NMI, 27 DIE_NMI,
29 DIE_DIE, 28 DIE_DIE,