From: Stephen Rothwell <sfr@canb.auug.org.au>
To: "David S. Miller" <davem@davemloft.net>
Cc: torvalds@osdl.org, akpm@osdl.org, linux-kernel@vger.kernel.org,
drepper@redhat.com, linux-arch@vger.kernel.org
Subject: Re: [PATCH] compat: fix compat_sys_openat and friends
Date: Thu, 2 Feb 2006 17:05:23 +1100 [thread overview]
Message-ID: <20060202170523.3ee85519.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20060201.215644.116024082.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1671 bytes --]
On Wed, 01 Feb 2006 21:56:44 -0800 (PST) "David S. Miller" <davem@davemloft.net> wrote:
>
> From: Linus Torvalds <torvalds@osdl.org>
> Date: Wed, 1 Feb 2006 21:36:40 -0800 (PST)
>
> > Wouldn't it be _much_ better to declare the argument as a "long", since
> > some architectures (alpha, for example) may assume that 32-bit arguments
> > have been _sign_extended, not zero-extended.
> >
> > Then, when the "compat_sys_xxxx()" function passes the "long" down to the
> > _real_ function (which takes an "int"), those architectures (and only
> > those architectures) that actually have assumptions about high bits will
> > have the compiler automatically do the right zero- or sign-extensions at
> > that call-site.
>
> There is the convention that for the compat system calls all the args
> will be 32-bit zero extended by the platform syscall entry code before
> the C code is invoked. This topic used to come up a lot and finally
> we all decided that was the thing to do.
>
> It's important (at least I think so :-) for all of this generic compat
> code to be able to have a well defined argument environment.
>
> Anyways, I think that's how Stephen arrived at his patch.
Yes, that is it. I have tried using "long" and "unsigned int" for those
first parameters and it produces exactly the same assembler output on
ppc64 and x86_64. Everywhere else that we have a file descriptor argument
to a compat syscall function it is declared "unsigned int".
And for these compat functions, alpha is irrelevent of course. :-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-02-02 6:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-02 5:11 Stephen Rothwell
2006-02-02 5:36 ` Linus Torvalds
2006-02-02 5:56 ` David S. Miller
2006-02-02 6:05 ` Stephen Rothwell [this message]
2006-02-02 6:11 ` Linus Torvalds
2006-02-02 12:01 ` Ralf Baechle
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=20060202170523.3ee85519.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=akpm@osdl.org \
--cc=davem@davemloft.net \
--cc=drepper@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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
all inboxes | Powered by JetHome®