Re: RFD: x32 ABI system call numbers

From: H.J. Lu
Date: Fri Sep 02 2011 - 22:56:47 EST


On Wed, Aug 31, 2011 at 10:05 AM, H.J. Lu <hjl.tools@xxxxxxxxx> wrote:
> On Wed, Aug 31, 2011 at 9:46 AM, Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>>
>> I really think that "x32" should try to aim *VERY* hard at using the
>> 64-bit system calls, and seeing itself as being a "32-bit application
>> in a 64-bit world".  That's not just true for time_t (which I think
>> should be 64-bit on anything new that expects to survive for any
>> amount of time), but in general.
>>
>
> I have been making x32 to use 64bit system calls as much as possible.
> Hopefully, I will get it to work in a week or 2.
>

I have an x32 kernel which usea 64bit time_t/timespec/timeval and file
system interface:

1. Use 64bit system calls as much as we can.
2. There are 32 compat system calls for x32 to support structure parameters
with pointers and longs.
3. Use x86-64 vDSO relocatable files directly to generate x32 vDSO.

We need to make decision on some system calls which take a pointer
to structure with long. For example, msg calls take a pointer to

struct msgbuf {
long mtype; /* message type, must be > 0 */
char mtext[1]; /* message data */
};

We have 3 choices:

1. Use long long for x32 and use 64bit msg system calls.
2. Keep long for x32 and use compat system call.
3. Add a 4byte padding for x32 and sign-extend from mtype to 4byte
padding before passing to 64bit msg system call.

I implemented option 1. I can also implement option 2 or 3.

Thanks.


--
H.J.
--
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/