From: Martin Schwidefsky <schwidefsky@de•ibm.com>
To: Heiko Carstens <heiko.carstens@de•ibm.com>
Cc: Eric Paris <eparis@redhat•com>, Sachin Sant <sachinp@in•ibm.com>,
linux-s390@vger•kernel.org,
Stephen Rothwell <sfr@canb•auug.org.au>,
linux-next@vger•kernel.org,
Andrew Morton <akpm@linux-foundation•org>,
linux-arch@vger•kernel.org
Subject: Re: [-next Nov 17] s390 build break(arch/s390/kernel/compat_wrapper.S)
Date: Thu, 19 Nov 2009 09:54:22 +0100 [thread overview]
Message-ID: <20091119095422.44e16a16@mschwide.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20091118184156.GB3973@osiris.boeblingen.de.ibm.com>
On Wed, 18 Nov 2009 19:41:56 +0100
Heiko Carstens <heiko.carstens@de•ibm.com> wrote:
> On Wed, Nov 18, 2009 at 06:34:00PM +0100, Martin Schwidefsky wrote:
> > used for parameter passing. 64 bit values are passed as registers pairs
> > with the first register an even numbered register. The effect of that
> > rule is that parameter registers may be skipped or that the whole 64 bit
> > value is passed on the stack. Examples:
>
> Erm, did I miss something? The 32 bit ABI doesn't say anything about
> even/odd register pairs for 64 bit values. Also gcc doesn't generate
> such code:
Odd, I can remember that there has been a rule like that. It is indeed
not in the ABI, seems like we dropped it/never added it. There are quite
a few 32 bit instruction that operate on 64 bit values in even/odd
registers which makes it beneficial to pass 64 bit values in a way that
they already are located in even/odd and not in odd/even registers.
> > fn(int a, long long b, int c)
> > a is passed in %r2, b is passed in %r4/%r5, c is passed in %r6, %r3 is
> > skipped.
>
> extern void fn(int a, long long b, int c);
>
> void bla(void)
> {
> fn(0, 1, 2);
> }
>
> 00000000 <bla>:
> 0: 90 ef f0 38 stm %r14,%r15,56(%r15)
> 4: a7 fa ff a0 ahi %r15,-96
> 8: a7 28 00 00 lhi %r2,0
> c: a7 38 00 00 lhi %r3,0
> 10: a7 48 00 01 lhi %r4,1
> 14: a7 58 00 02 lhi %r5,2
> 18: c0 e5 00 00 00 00 brasl %r14,18 <bla+0x18>
> 1e: 98 ef f0 98 lm %r14,%r15,152(%r15)
> 22: 07 fe br %r14
>
> Not that it really matters, since other archs enforce the rule anyway.
Perhaps that is what confused me. Anyway, the thing to remember here is
that passing a long long as the last parameter which would end up in
%r6/%r7 requires a system call wrapper for the standard 32 bit system
call for a 32 bit kernel. So please don't do that.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
next prev parent reply other threads:[~2009-11-19 8:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-17 8:53 linux-next: Tree for November 17 Stephen Rothwell
2009-11-17 12:06 ` [-next Nov 17] s390 build break(arch/s390/kernel/compat_wrapper.S) Sachin Sant
2009-11-17 12:52 ` Heiko Carstens
2009-11-17 13:40 ` Eric Paris
2009-11-17 13:55 ` Heiko Carstens
2009-11-17 15:23 ` Eric Paris
2009-11-17 15:50 ` Heiko Carstens
2009-11-17 15:57 ` Eric Paris
2009-11-17 16:14 ` Heiko Carstens
2009-11-18 7:04 ` Heiko Carstens
2009-11-18 9:27 ` Russell King
2009-11-18 14:49 ` Ralf Baechle
2009-11-18 16:02 ` Eric Paris
2009-11-18 16:22 ` Heiko Carstens
2009-11-18 17:34 ` Martin Schwidefsky
2009-11-18 18:41 ` Heiko Carstens
2009-11-19 8:54 ` Martin Schwidefsky [this message]
2009-11-18 17:24 ` Eric Paris
2009-11-17 17:02 ` linux-next: Tree for November 17 (exofs) Randy Dunlap
2009-11-17 17:08 ` Boaz Harrosh
2009-11-17 17:10 ` Boaz Harrosh
2009-11-17 17:24 ` Boaz Harrosh
2009-11-17 17:48 ` Randy Dunlap
2009-11-17 18:17 ` [PATCH -next] sep: fix 2 warnings Randy Dunlap
2009-11-17 18:29 ` Alan Cox
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=20091119095422.44e16a16@mschwide.boeblingen.de.ibm.com \
--to=schwidefsky@de$(echo .)ibm.com \
--cc=akpm@linux-foundation$(echo .)org \
--cc=eparis@redhat$(echo .)com \
--cc=heiko.carstens@de$(echo .)ibm.com \
--cc=linux-arch@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=linux-s390@vger$(echo .)kernel.org \
--cc=sachinp@in$(echo .)ibm.com \
--cc=sfr@canb$(echo .)auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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