Re: RFD: x32 ABI system call numbers

From: Andy Lutomirski
Date: Fri Sep 02 2011 - 02:18:24 EST


On 08/26/2011 07:39 PM, H. Peter Anvin wrote:
On 08/26/2011 04:13 PM, Linus Torvalds wrote:

The extra bit would be masked off and only affect device drivers like
input which relies on is_compat().

So a couple of questions:

- why do we need another system call model at all?

We think we can get more performance for a process which doesn't need
more than 4 GiB of virtual address space by allowing them to keep
pointers 4 bytes long, while still giving them the advantage of 16
64-bit registers, PC-relative addressing, and so on. Furthermore, there
are users who seem more willing to port code known to not be 64-bit
clean to x32 than to do a whole new port.

If the question is "why not just thunk this in userspace", the answer is
that we'd like to take advantage of the compat layer already in the kernel.

If the question is "why not just use int $0x80" we actually did that in
early prototyping, but SYSCALL64 is much faster.

This may be a dumb question, but:

Why not just set some high bit of rax to enable compat syscalls to be issued with the 64-bit SYSCALL instruction. This could be done with zero overhead for normal 64-bit code (you can just adjust the existing system-call-number-too-high path) and the total kernel patch should be just a handful of lines. Does x32 need any more kernel support than that? You'll confuse strace on new binaries, but that shouldn't be a big deal.

Also, why do ioctls and userspace structs need any translation at all? This is a new ABI -- why not just teach x32 code to stick zeros in its structs in the appropriate places to use the 64-bit layout.

--Andy
--
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/