From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
linux-arch <linux-arch@vger.kernel.org>,
Ralf Baechle <ralf@linux-mips.org>,
James Hogan <jhogan@kernel.org>,
linux-mips <linux-mips@linux-mips.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
ppc-dev <linuxppc-dev@lists.ozlabs.org>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
linux-s390 <linux-s390@vger.kernel.org>,
"David S . Miller" <davem@davemloft.net>,
sparclinux@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Jiri Slaby <jslaby@suse.com>,
the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [RFC PATCH 4/6] mm: provide generic compat_sys_readahead() implementation
Date: Sun, 18 Mar 2018 18:18:48 +0000 [thread overview]
Message-ID: <20180318181848.GU30522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+55aFwuZCpAZRpsTGiUmG065ZHHpj+03_NeWiy-OGkMGw7e3g@mail.gmail.com>
On Sun, Mar 18, 2018 at 11:06:42AM -0700, Linus Torvalds wrote:
> and then we can do
>
> COMPAT_SYSCALL_DEFINE5(readahead, int, fd,
> COMPAT_ARG_64BIT_ODD(off), compat_size_t, count)
> {
> return do_readahead(fd, off_lo + ((u64)off_hi << 64), count);
> }
>
> which at least looks reasonably legible, and has *zero* ifdef's anywhere.
It's a bit more complicated, but...
> I do *not* want to see those disgusting __ARCH_WANT_LE_COMPAT_SYS
> things and crazy #ifdef's in code.
Absolutely. Those piles of ifdefs are unreadable garbage.
> So either let the architectures do their own trivial wrappers
> entirely, or do something clean like the above. Do *not* do
> #ifdef'fery at the system call declaration time.
>
> Also note that the "ODD" arguments may not be the ones that need
> padding. I could easily see a system call argument numbering scheme
> like
>
> r0 - system call number
> r1 - first argument
> r2 - second argument
> ...
>
> and then it's the *EVEN* 64-bit arguments that would need the padding
> (because they are actually odd in the register numbers). The above
> COMPAT_ARG_64BIT[_ODD]() model allows for that too.
>
> Of course, if some architecture then has some other arbitrary rules (I
> could see register pairing rules that aren't the usual "even register"
> ones), then such an architecture would really have to have its own
> wrapper, but the above at least would handle the simple cases, and
> doesn't look disgusting to use.
I'd done some digging in that area, will find the notes and post.
Basically, we can even avoid the odd/even annotations and have
COMPAT_SYSCALL_DEFINE... sort it out. It's a bit more hairy than
I would like at this stage in the cycle, though. I'll see if it can
be done without too much PITA.
However, there still are genuinely speci^Wfucked in head cases - see
e.g. this sad story:
commit ab8a261ba5e2dd9206da640de5870cc31d568a7c
Author: Helge Deller <deller@gmx.de>
Date: Thu Jul 10 18:07:17 2014 +0200
parisc: fix fanotify_mark() syscall on 32bit compat kernel
Those certainly ought to stay in arch/*
next prev parent reply other threads:[~2018-03-18 18:19 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180318161056.5377-1-linux@dominikbrodowski.net>
2018-03-18 16:10 ` [RFC PATCH 1/6] fs: provide a generic compat_sys_fallocate() implementation Dominik Brodowski
2018-03-18 16:10 ` [RFC PATCH 2/6] fs: provide a generic compat_sys_truncate64() implementation Dominik Brodowski
2018-03-18 17:49 ` Al Viro
2018-03-18 18:21 ` Linus Torvalds
2018-03-19 6:29 ` Kevin Easton
2018-03-18 16:10 ` [RFC PATCH 3/6] fs: provide generic compat_sys_p{read, write}64() implementations Dominik Brodowski
2018-03-18 17:40 ` Linus Torvalds
2018-03-18 18:05 ` Al Viro
2018-03-18 16:10 ` [RFC PATCH 4/6] mm: provide generic compat_sys_readahead() implementation Dominik Brodowski
2018-03-18 17:40 ` Al Viro
2018-03-18 18:06 ` Linus Torvalds
2018-03-18 18:18 ` Al Viro [this message]
2018-03-19 4:23 ` Al Viro
2018-03-19 9:29 ` Ingo Molnar
2018-03-19 23:23 ` Al Viro
2018-03-20 8:56 ` Dominik Brodowski
2018-03-20 8:59 ` Ingo Molnar
2018-03-22 0:15 ` Al Viro
2018-03-26 0:40 ` [RFC] new SYSCALL_DEFINE/COMPAT_SYSCALL_DEFINE wrappers Al Viro
2018-03-26 3:47 ` Al Viro
2018-03-26 6:15 ` Linus Torvalds
2018-03-26 6:20 ` Linus Torvalds
2018-03-26 6:44 ` John Paul Adrian Glaubitz
2018-03-27 1:03 ` Linus Torvalds
2018-03-27 2:37 ` John Paul Adrian Glaubitz
2018-03-27 3:40 ` Linus Torvalds
2018-03-27 4:58 ` John Paul Adrian Glaubitz
2018-03-30 10:58 ` Ingo Molnar
2018-03-30 15:54 ` Adam Borowski
2018-03-26 6:24 ` Dominik Brodowski
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=20180318181848.GU30522@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=jhogan@kernel.org \
--cc=jslaby@suse.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=ralf@linux-mips.org \
--cc=schwidefsky@de.ibm.com \
--cc=sparclinux@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.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).