public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* x86: do_debug && PTRACE_SINGLESTEP broken by 08d68323d1f0c34452e614263b212ca556dae47f
@ 2009-12-18  0:56 Oleg Nesterov
  2009-12-18  1:40 ` Roland McGrath
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Oleg Nesterov @ 2009-12-18  0:56 UTC (permalink / raw)
  To: K.Prasad, Alan Stern, Frederic Weisbecker, Ingo Molnar,
	Roland McGrath
  Cc: linux-kernel, utrace-devel

Hi.

do_debug() is obviously wrong wrt PTRACE_SINGLESTEP/TIF_SINGLESTEP, no?

Afaics this was broken by

	hw-breakpoints: modifying generic debug exception to use thread-specific debug registers
	commit 08d68323d1f0c34452e614263b212ca556dae47f

To verify, the "patch" below fixes the stepping for me, not sure what
is the proper fix...

Oleg.

--- arch/x86/kernel/traps.c~	2009-12-18 00:20:49.000000000 +0100
+++ arch/x86/kernel/traps.c	2009-12-18 01:44:05.000000000 +0100
@@ -575,7 +575,7 @@ dotraplinkage void __kprobes do_debug(st
 		regs->flags &= ~X86_EFLAGS_TF;
 	}
 	si_code = get_si_code(tsk->thread.debugreg6);
-	if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS))
+//	if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS))
 		send_sigtrap(tsk, regs, error_code, si_code);
 	preempt_conditional_cli(regs);
 


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2009-12-21 16:49 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-18  0:56 x86: do_debug && PTRACE_SINGLESTEP broken by 08d68323d1f0c34452e614263b212ca556dae47f Oleg Nesterov
2009-12-18  1:40 ` Roland McGrath
2009-12-18  2:10   ` Oleg Nesterov
2009-12-18  2:58     ` Frederic Weisbecker
2009-12-18  3:09       ` Frederic Weisbecker
2009-12-18  3:53     ` Roland McGrath
2009-12-18  3:06 ` Frederic Weisbecker
2009-12-18 17:27   ` Oleg Nesterov
2009-12-18 17:58     ` K.Prasad
2009-12-18 18:24       ` Oleg Nesterov
2009-12-18 20:05     ` Roland McGrath
2009-12-18 22:32       ` Oleg Nesterov
2009-12-21 10:22         ` Jan Kiszka
2009-12-21 16:53           ` Oleg Nesterov
2009-12-21 16:48             ` Jan Kiszka
2009-12-18 23:15       ` Frederic Weisbecker
2009-12-20  8:30         ` Avi Kivity
2009-12-18 17:37 ` K.Prasad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox