Re: [RFC PATCH] x86 single-step (TF) vs system calls & traps

From: Linus Torvalds
Date: Tue Jun 29 2004 - 00:19:50 EST




On Mon, 28 Jun 2004, Roland McGrath wrote:
>
> The issue does indeed arise using sysenter, as I explained and is easily
> demonstrated by trying it. I'm not sure what you mean here when you say,
> "by hand". The TF trap taken in kernel mode upon sysenter entry causes the
> kernel to return using iret, which restores the TF flag in exactly the same
> way as returning from other kinds of traps, and likewise executes the
> following user-mode instruction.

They are "user-mode" only in theory.

They are really kernel instructions set up by the kernel, and user-mode
only in the sense that yes, they run in ring3. No actual user-compiled
code executed anywhere.

At least to me, that vsyscall trampoline is all kernel code. But yes,
you're right, we no longer do the eflags save/restore in user mode, that
was too slow (some of my first versions just cleared TF unconditionally,
and the trampoline was responsible for re-enabling it).

> Are you referring to the signal trampoline for returning from signal
> handlers? If you are referring to some other trampoline, please clear up
> my confusion.

I was talking about the vsyscall code.

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/