Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20238
b: refs/heads/master
c: a65d17c
h: refs/heads/master
v: v3
  • Loading branch information
John Blackwood authored and Linus Torvalds committed Feb 13, 2006
1 parent fc6075e commit 3ef5161
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8f6da52aeff1fd7272ff5082552a39c050565b57
refs/heads/master: a65d17c9d27a85782cfe1bbc36c747ffa1f81814
18 changes: 17 additions & 1 deletion trunk/arch/x86_64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@ static inline void conditional_sti(struct pt_regs *regs)
local_irq_enable();
}

static inline void preempt_conditional_sti(struct pt_regs *regs)
{
preempt_disable();
if (regs->eflags & X86_EFLAGS_IF)
local_irq_enable();
}

static inline void preempt_conditional_cli(struct pt_regs *regs)
{
if (regs->eflags & X86_EFLAGS_IF)
local_irq_disable();
preempt_enable_no_resched();
}

static int kstack_depth_to_print = 10;

#ifdef CONFIG_KALLSYMS
Expand Down Expand Up @@ -693,7 +707,7 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,
SIGTRAP) == NOTIFY_STOP)
return;

conditional_sti(regs);
preempt_conditional_sti(regs);

/* Mask out spurious debug traps due to lazy DR7 setting */
if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) {
Expand Down Expand Up @@ -738,11 +752,13 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,

clear_dr7:
set_debugreg(0UL, 7);
preempt_conditional_cli(regs);
return;

clear_TF_reenable:
set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
regs->eflags &= ~TF_MASK;
preempt_conditional_cli(regs);
}

static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr)
Expand Down

0 comments on commit 3ef5161

Please sign in to comment.