[lkml]   [2004]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: compat syscall args
On Tuesday 01 June 2004 07:06, Stephen Rothwell wrote:
> On Sat, 29 May 2004 12:23:19 -0700 "David S. Miller" <> wrote:
> > I remember discussing this with Andi Kleen before.
> Yeah, you and Andi and I (and others, I think) had this discussion, but it ended like this:
> > Subject: Re: [PATCH] Consolidate sys32_utime
> > From: "David S. Miller" <>
> >
> > So be it, the convention is that all arguments are zero extended from
> > 32-bits to 64-bits when the syscall is invoked.
> Did something change along the way?

I wasn't aware of the convention but it absolutely makes sense. If I find
the time, I'll go through the existing compat_sys_* handlers to see if they
all do sign-extension correctly. Note that on s390, we also need 31-bit
zero-extension for pointers, which is done in architecture-specific code.
Otherwise every compat_* syscall would need to use compat_uptr_t arguments
which appears unnecessarily ugly to me.

Also, what should be the conversion for positive signed arguments like the
futex 'op' value? Sign-extension would be the formally correct solution,
but simply using the zero-extended value (like we do in most places) works
just as well.

Arnd <><
[unhandled content-type:application/pgp-signature]
 \ /
  Last update: 2005-03-22 14:03    [W:0.087 / U:0.416 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site