Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323850
b: refs/heads/master
c: 95cf00f
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov committed Sep 15, 2012
1 parent 465a862 commit a7fa559
Show file tree
Hide file tree
Showing 2 changed files with 14 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: 848e8f5f0ad3169560c516fff6471be65f76e69f
refs/heads/master: 95cf00fa5d5e2a200a2c044c84bde8389a237e02
14 changes: 13 additions & 1 deletion trunk/arch/x86/kernel/step.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ static void set_task_blockstep(struct task_struct *task, bool on)
{
unsigned long debugctl;

/*
* Ensure irq/preemption can't change debugctl in between.
* Note also that both TIF_BLOCKSTEP and debugctl should
* be changed atomically wrt preemption.
* FIXME: this means that set/clear TIF_BLOCKSTEP is simply
* wrong if task != current, SIGKILL can wakeup the stopped
* tracee and set/clear can play with the running task, this
* can confuse the next __switch_to_xtra().
*/
local_irq_disable();
debugctl = get_debugctlmsr();
if (on) {
debugctl |= DEBUGCTLMSR_BTF;
Expand All @@ -169,7 +179,9 @@ static void set_task_blockstep(struct task_struct *task, bool on)
debugctl &= ~DEBUGCTLMSR_BTF;
clear_tsk_thread_flag(task, TIF_BLOCKSTEP);
}
update_debugctlmsr(debugctl);
if (task == current)
update_debugctlmsr(debugctl);
local_irq_enable();
}

/*
Expand Down

0 comments on commit a7fa559

Please sign in to comment.