It's not destroyed if you just say "you can only use SYSENTER with the
standard SS and DS".
Then the SYSENTER code just builds a perfectly normal stack, EXACTLY as if
it was entered with a regular system call. Again, absolutely no special
cases. We just hardcode the return address (from the user stack), SS and
DS - exactly because they get destroyed by the instruction itself.
Then, the return path has the same stack regardless of whether it was
entered through a page fault, a old system call or a new system call. And
it always tries to return with SYSEXIT.
The problem with SYSEXIT is that it clobbers %edx and %ecx (or whatever -
I forget what the registers were and I'm too lazy to look them up), and
that makes it nasty to use for the generic case. But we'd have that user-
space fixup area..
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/