From: Heiko Carstens <heiko.carstens@de•ibm.com>
To: Eric Paris <eparis@redhat•com>
Cc: 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>,
Martin Schwidefsky <schwidefsky@de•ibm.com>,
linux-arch@vger•kernel.org
Subject: Re: [-next Nov 17] s390 build break(arch/s390/kernel/compat_wrapper.S)
Date: Wed, 18 Nov 2009 17:22:33 +0100 [thread overview]
Message-ID: <20091118162232.GA3973@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <1258560177.6446.19.camel@dhcp231-106.rdu.redhat.com>
On Wed, Nov 18, 2009 at 11:02:57AM -0500, Eric Paris wrote:
>
> asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
>
> sys_fallocate_wrapper:
> lgfr %r2,%r2 # int
> lgfr %r3,%r3 # int
> sllg %r4,%r4,32 # get high word of 64bit loff_t
> lr %r4,%r5 # get low word of 64bit loff_t
> sllg %r5,%r6,32 # get high word of 64bit loff_t
> l %r5,164(%r15) # get low word of 64bit loff_t
> jg sys_fallocate
>
> Does this work? It's basically the same thing, right? I'm willing to
> hear "that's fine you are clueless" Just saw it and hoping that we
> have everything right....
It works, because for 32 bit s390 it's not the interface above but this one:
(see arch/s390/kernel/sys_s390.c):
/*
* This is a wrapper to call sys_fallocate(). For 31 bit s390 the last
* 64 bit argument "len" is split into the upper and lower 32 bits. The
* system call wrapper in the user space loads the value to %r6/%r7.
* The code in entry.S keeps the values in %r2 - %r6 where they are and
* stores %r7 to 96(%r15). But the standard C linkage requires that
* the whole 64 bit value for len is stored on the stack and doesn't
* use %r6 at all. So s390_fallocate has to convert the arguments from
* %r2: fd, %r3: mode, %r4/%r5: offset, %r6/96(%r15)-99(%r15): len
* to
* %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len
*/
SYSCALL_DEFINE(s390_fallocate)(int fd, int mode, loff_t offset,
u32 len_high, u32 len_low)
{
return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low);
}
#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
asmlinkage long SyS_s390_fallocate(long fd, long mode, loff_t offset,
long len_high, long len_low)
{
return SYSC_s390_fallocate((int) fd, (int) mode, offset,
(u32) len_high, (u32) len_low);
}
SYSCALL_ALIAS(sys_s390_fallocate, SyS_s390_fallocate);
#endif
We (or better: Martin ;) had to define a special s390 fallocate system call
because the "real" system call interface doesn't work on s390 for the same
reason like your proposed system call.
next prev parent reply other threads:[~2009-11-18 16:22 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 [this message]
2009-11-18 17:34 ` Martin Schwidefsky
2009-11-18 18:41 ` Heiko Carstens
2009-11-19 8:54 ` Martin Schwidefsky
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=20091118162232.GA3973@osiris.boeblingen.de.ibm.com \
--to=heiko.carstens@de$(echo .)ibm.com \
--cc=akpm@linux-foundation$(echo .)org \
--cc=eparis@redhat$(echo .)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=schwidefsky@de$(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