No, your "real" code sequence is wrong.
%ebx/%edi/%esi are preserved across sysenter/sysexit, whereas
%ecx/%edx are call-clobbered registers in the i386 function call ABI.
This is not a coincidence.
So, getpid looks like this with the _smaller_ vsyscall code:
getpid():
movl $__NR_getpid,%eax
call *%gs:0x18
ret
Intel didn't choose %ecx/%edx as the sysexit registers by accident.
They were chosen for exactly this reason.
By the way, the same applies to AMD's syscall/sysret, which clobbers %ecx.
What I'm suggesting is that we should say that "call 0xffffe000"
clobbers only the registers (%eax/%ecx/%edx) that _normal_ function
calls clobber on i386, and preserves the call-saved registers.
This keeps the size of system call stubs in libc to the minimum.
Think about it.
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/