Commit 28477fb1 authored by Dave Kleikamp's avatar Dave Kleikamp Committed by Benjamin Herrenschmidt

powerpc: Fix booke user_disable_single_step()

On booke processors, gdb is seeing spurious SIGTRAPs when setting a
watchpoint.

user_disable_single_step() simply quits when the DAC is non-zero.  It should
be clearing the DBCR0_IC and DBCR0_BT bits from the dbcr0 register and
TIF_SINGLESTEP from the thread flag.
Signed-off-by: default avatarDave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent e9e961c9
...@@ -736,15 +736,16 @@ void user_disable_single_step(struct task_struct *task) ...@@ -736,15 +736,16 @@ void user_disable_single_step(struct task_struct *task)
{ {
struct pt_regs *regs = task->thread.regs; struct pt_regs *regs = task->thread.regs;
if (regs != NULL) {
#if defined(CONFIG_BOOKE) #if defined(CONFIG_BOOKE)
/* If DAC then do not single step, skip */ /* If DAC don't clear DBCRO_IDM or MSR_DE */
if (task->thread.dabr) if (task->thread.dabr)
return; task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT);
#endif else {
task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM);
if (regs != NULL) { regs->msr &= ~MSR_DE;
#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) }
#elif defined(CONFIG_40x)
task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM); task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM);
regs->msr &= ~MSR_DE; regs->msr &= ~MSR_DE;
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment