Re: i386 singlestep is borken

From: Linus Torvalds
Date: Thu Feb 16 2006 - 11:30:01 EST




On Thu, 16 Feb 2006, Chuck Ebbert wrote:
>
> 2. Makes vsyscall; debug trap occurs in kernel mode and TF
> is cleared. TIF_SINGLESTEP gets set so kernel will remember
> to re-enable TF on return to user. But when user eflags
> is saved on the stack, TF has already been cleared.

This is exactly correct.

TF should be re-enabled by the "is there work to be done at system call
return time?" logic, which should mean that we go through
do_notify_resume() (which will set TF_MASK) and return with an "iret".

We can't return with a sysexit in the TF case, and setting TF on the stack
is thus useless.

> 3. When user gets control back, TF is not re-enabled.

Sounds like something is broken, but I don't see what.

I did check single-step over sysenter at some point (a long time ago), so
this has worked.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/