Skip to contentSkip to conversation

powerpc: Fix ppc32 single step out of syscalls

PATCH New Benjamin Herrenschmidt 1 participant 1 message May 24, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix ppc32 single step out of syscalls

The ppc32 kernel didn't properly set/clear the TIF_SINGLESTEP flag causing return from syscalls to not SIGTRAP, thus executing one more instruction before stopping again.

This fixes it. The ptrace code is a bit of a mess, and is overdue of at least a -proper- 32/64 bits split and possibly more cleanups but this minimum fix should be ok for 2.6.22

---

 arch/powerpc/kernel/ptrace.c |    2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/kernel/ptrace.c +2 -0
Index: linux-cell/arch/powerpc/kernel/ptrace.c
===================================================================
@@ -218,6 +218,7 @@ set_single_step(struct task_struct *task
 		regs->msr |= MSR_SE;
 #endif
 	}
+	set_tsk_thread_flag(task, TIF_SINGLESTEP);
 }
 
 static inline void
@@ -233,6 +234,7 @@ clear_single_step(struct task_struct *ta
 		regs->msr &= ~MSR_SE;
 #endif
 	}
+	clear_tsk_thread_flag(task, TIF_SINGLESTEP);
 }
 #endif /* CONFIG_PPC32 */