This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: X32 psABI status


On Sunday 13 February 2011, H. Peter Anvin wrote:
> We prototyped using the int $0x80 system call entry point.  However,
> there are two disadvantages:
> 
> a. the int $0x80 instruction is much slower than syscall.  An actual
>    i386 process can use the syscall instruction which is disambiguated
>    by the CPU based on mode, but an x32 process is in the same CPU mode
>    as a normal 64-bit process.

Well, you could simply change entry.S to allow syscall with high numbers
to have the same effect as int $0x80, but not introduce another table
to solve this.

> b. 64-bit arguments have to be split between two registers for the
>    i386 entry points, requiring user-space stubs.

64 bit arguments are very rare, and most of those syscalls are not
performance critical, so this could be dealt with on a case-by-case
basis, possibly by introducing a new syscall number for the variant
passing a 64 bit register.

> All in all, the cost of an extra system call table is quite modest.

The memory size overhead may be small, but auditing another table
for every change could become a noticable burden (your though, not mine).

> The cost of an entire different ABI layer (supporting a new memory layout)
> would be enormous, a.k.a. "not worth it", which is why the memory layout
> of kernel objects needs to be compatible with i386.

Right, this makes sense, you certainly can't redefine all the data
structures. 

What would probably be a good idea is to compare the set of syscalls
in X32 and asm-generic, and to either eliminate or document the
differences. You can probably even take the asm-generic syscall numbers,
even if you keep the i386 data structures.

	Arnd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]