lkml.org 
[lkml]   [2005]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Date
From
SubjectRe: [patch 1/1] x86-64: forgot asmlinkage on sys_mmap
On Wed, Mar 09, 2005 at 07:24:00PM +0100, Blaisorblade wrote:
> On Wednesday 09 March 2005 18:24, Andi Kleen wrote:
> > blaisorblade@yahoo.it writes:
> > > CC: Andi Kleen <ak@suse.de>
> > >
> > > I think it should be there, please check better.
> >
> > It doesn't matter. asmlinkage is a nop on x86-64.
>
> Yes, otherwise nothing would work on x86-64 with mmap broken, but for
> cleanness and for the case this change it should be there (otherwise why
> asmlinkage is used in the rest of the file).

Only because it was cut'n'pasted from i386 originally.

>
> And for i386 asmlinkage acquired significance only recently.

Actually it doesn't neither on i386. That's because entry.S happens to put the
arguments both into registers and the stack in the right order, so both
register and stack argument calling conventions work.

But it is slightly safer to have it. When you use the stack arguments
the C code is allowed to modify it, and when the system call is restarted
later you could see garbage. In practice that's not a big issue because
only very few system calls are restartable.

ptrace also could see corrupted state, but that's in general a non issue.

-Andi

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

\
 
 \ /
  Last update: 2005-03-22 14:11    [W:0.158 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site