[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180318181848.GU30522@ZenIV.linux.org.uk>
Date: Sun, 18 Mar 2018 18:18:48 +0000
From: Al Viro <viro@...IV.linux.org.uk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Dominik Brodowski <linux@...inikbrodowski.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
linux-arch <linux-arch@...r.kernel.org>,
Ralf Baechle <ralf@...ux-mips.org>,
James Hogan <jhogan@...nel.org>,
linux-mips <linux-mips@...ux-mips.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
ppc-dev <linuxppc-dev@...ts.ozlabs.org>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
linux-s390 <linux-s390@...r.kernel.org>,
"David S . Miller" <davem@...emloft.net>,
sparclinux@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Jiri Slaby <jslaby@...e.com>,
the arch/x86 maintainers <x86@...nel.org>
Subject: Re: [RFC PATCH 4/6] mm: provide generic compat_sys_readahead()
implementation
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@....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/*
Powered by blists - more mailing lists