linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Munroe <munroesj@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Ulrich Drepper <drepper@redhat.com>,
	munroesj@us.ibm.com, David Miller <davem@davemloft.net>,
	ralf@linux-mips.org, linux-arch@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel@teksavvy.com,
	torvalds@linux-foundation.org
Subject: Re: 64-syscall args on 32-bit vs syscall()
Date: Thu, 18 Mar 2010 11:08:00 -0500	[thread overview]
Message-ID: <1268928480.19726.123.camel@spokane1.rchland.ibm.com> (raw)
In-Reply-To: <1268866720.2335.204.camel@pasglop>

On Thu, 2010-03-18 at 09:58 +1100, Benjamin Herrenschmidt wrote:
> On Wed, 2010-03-17 at 13:53 -0700, H. Peter Anvin wrote:
> > > Yeah, whatever, I don't mind what technique you use for the
> > versionning,
> > > ultimately, if the approach works, we can look at those details :-)
> > We
> > > -do- need the macro to strip the dummy argument though, unless we
> > use
> > > a slightly different technique which is to make the __sysno argument
> > > itself 64-bit, which works as well I believe.
> > >
> > 
> > It seems cleaner to do it that way (with a 64-bit sysno arg.) 
> 
> Right. Now if we can get Ulrich to actually put 2 and 2 together and
> admit that it actually works without breaking anything existing (at
> least for my arch but I wouldn't be surprised if that was the case for
> others), I would be even happier :-)
> 
> Steve, any chance you can cook up a glibc patch to test with ? Maybe
> making it powerpc specific for now ?
> 

Do what declare __sysno as long long? The current prototype is in
unistd.h:

#ifdef __USE_MISC
/* Invoke `system call' number SYSNO, passing it the remaining
arguments.
   This is completely system-dependent, and not often useful.

   In Unix, `syscall' sets `errno' for all errors and most calls return
-1
   for errors; in many systems you cannot pass arguments or get return
   values for all system calls (`pipe', `fork', and `getppid' typically
   among them).

   In Mach, all system calls take normal arguments and always return an
   error code (zero for success).  */
extern long int syscall (long int __sysno, ...) __THROW;

#endif	/* Use misc.  */

Changing this would be an ABI change and would have to be versioned. It
would effect any one using syscall not just SYS_fallocate.

the question is do programmers in practice include unistd.h when they
use syscall.

If the changed prototype is not in scope then the 1st parm (__sysno)
defaults to int and is passed in on r3 which gets moved to r0.

If the changed syscall prototype is in scope then then _sysno would be
passed in r3/r4 (r3 would be 0 would be passed to r0 and the actual
system number would be in r4 and passed to the kernel in r3)

which behavior do you want? which (incorrect behavior compiled into
existing codes do you want to support?

Do you want syscall.S for PPC32 to change to match the changed
prototype? It will have to be be versioned and the new prototype will
only be available in future releases of GLIBC. Existing applications
will bind to the old ABI and get the old behavior.

  parent reply	other threads:[~2010-03-18 15:58 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-15  4:48 64-syscall args on 32-bit vs syscall() Benjamin Herrenschmidt
2010-03-15  4:48 ` Benjamin Herrenschmidt
2010-03-15  5:06 ` David Miller
2010-03-15  5:18   ` Benjamin Herrenschmidt
2010-03-15  5:54     ` David Miller
2010-03-15 20:22       ` Benjamin Herrenschmidt
2010-03-15 13:44     ` Ralf Baechle
2010-03-15 15:13       ` H. Peter Anvin
2010-03-15 16:00         ` Ulrich Drepper
2010-03-15 19:00           ` David Miller
2010-03-15 19:41             ` H. Peter Anvin
2010-03-15 20:35               ` Benjamin Herrenschmidt
2010-03-15 20:41                 ` H. Peter Anvin
2010-03-16 21:56                 ` Steven Munroe
2010-03-17  0:31                   ` Benjamin Herrenschmidt
2010-03-17  0:31                     ` Benjamin Herrenschmidt
2010-03-17  5:52                     ` Ulrich Drepper
2010-03-17  8:56                       ` Benjamin Herrenschmidt
2010-03-17  9:14                         ` Ulrich Drepper
2010-03-17 10:13                           ` Benjamin Herrenschmidt
2010-03-17  9:18                         ` Jamie Lokier
2010-03-17 10:18                           ` Benjamin Herrenschmidt
2010-03-17 18:30                         ` H. Peter Anvin
2010-03-17 20:35                           ` Benjamin Herrenschmidt
2010-03-17 20:53                             ` H. Peter Anvin
2010-03-17 22:58                               ` Benjamin Herrenschmidt
2010-03-17 22:58                                 ` Benjamin Herrenschmidt
2010-03-18 16:08                                 ` Steven Munroe [this message]
2010-03-18 16:21                                   ` Andreas Schwab
2010-03-18 16:21                                     ` Andreas Schwab
2010-03-18 17:03                                     ` Steven Munroe
2010-03-18 21:18                                       ` Benjamin Herrenschmidt
2010-03-19  1:22                                         ` Jamie Lokier
2010-03-15 20:27       ` Benjamin Herrenschmidt
2010-03-15 15:03 ` Steven Munroe
2010-03-15 20:32   ` Benjamin Herrenschmidt
2010-03-15 15:04 ` Jamie Lokier
2010-03-15 20:33   ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1268928480.19726.123.camel@spokane1.rchland.ibm.com \
    --to=munroesj@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=drepper@redhat.com \
    --cc=hpa@zytor.com \
    --cc=kernel@teksavvy.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=munroesj@us.ibm.com \
    --cc=ralf@linux-mips.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).