Skip to contentSkip to conversation

Fix avr32 TIF atomicity in do_debug_priv

PATCH In review Mathieu Desnoyers 2 participants 2 messages Mar 9, 2007 ptrace support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix avr32 TIF atomicity in do_debug_priv

Fix avr32 TIF atomicity in do_debug_priv

avr32 updates the thread flags 1 - non atomically and 2 - with the wrong value (for TIF_SINGLE_STEP) in this function.

It applies to 2.6.20.

arch/avr32/kernel/ptrace.c +2 -4
@@ -306,14 +306,12 @@ asmlinkage void do_debug_priv(struct pt_regs *regs)
 	if (likely(ds & DS_SSS)) {
 		extern void itlb_miss(void);
 		extern void tlb_miss_common(void);
-		struct thread_info *ti;
 
 		dc = __mfdr(DBGREG_DC);
 		dc &= ~DC_SS;
 		__mtdr(DBGREG_DC, dc);
 
-		ti = current_thread_info();
-		ti->flags |= _TIF_BREAKPOINT;
+		set_tsk_thread_flag(tsk, TIF_BREAKPOINT);
 
 		/* The TLB miss handlers don't check thread flags */
 		if ((regs->pc >= (unsigned long)&itlb_miss)
@@ -328,7 +326,7 @@ asmlinkage void do_debug_priv(struct pt_regs *regs)
 		 * single step.
 		 */
 		if ((regs->sr & MODE_MASK) != MODE_SUPERVISOR)
-			ti->flags |= TIF_SINGLE_STEP;
+			set_tsk_thread_flag(tsk, TIF_SINGLE_STEP);
 	} else {
 		panic("Unable to handle debug trap at pc = %08lx\n",
 		      regs->pc);
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#1 lore raw
Quoted 6 lines · On Thu, 8 Mar 2007 22:21:37 -0500 Mathieu Desnoyers…

Fix avr32 TIF atomicity in do_debug_priv

avr32 updates the thread flags 1 - non atomically and 2 - with the wrong value (for TIF_SINGLE_STEP) in this function.

It applies to 2.6.20.

Thanks, but this has already been fixed by a19b4a14053f for 2.6.21.

Haavard