linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: "H. Peter Anvin" <hpa@zytor.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	akpm@linux-foundation.org, mm-commits@vger.kernel.org,
	arnd@arndb.de, linux-api@vger.kernel.org, linux-arch@vger
Subject: Re: + preadv-pwritev-add-preadv-and-pwritev-system-calls.patch added to -mm tree
Date: Tue, 3 Feb 2009 12:19:54 -0800 (PST)	[thread overview]
Message-ID: <f8847f63cb4945a447b11df7706754a7.squirrel@www.zytor.com> (raw)
In-Reply-To: <20090203174257.GC20898@flint.arm.linux.org.uk>

>
> I'm thinking there of the silly fadvise64_64 syscall, where ARM was forced
> into having a different argument ordering from everything else through
> zero discussion.
>
> So, what would your scripts do with the fadvise64_64 syscall on an
> architecture requiring natural alignment of the 64-bit args in 32-bit
> regs?
>

It depends on the exact rules: in most cases, it doesn't have to do
anything, because the calling convention on the user side and on the
kernel side simply cancel out.  This was lesson #1 while implementing
klibc (which does all system calls that aren't totally ad hoc via
autogenerated stubs.)  If, however, it is needed, the scripts I have can
handle arbitrary weirdness, including stuff like needing manual splitting
and even passing 64-bit arguments by reference.

The important bit here is consistent rules, but ad hoc rules that are per
system call (as opposed to a set of *per platform* rules that are adhered
to) is just a disaster -- and one from which we can never recover with any
kind of automation.  Inconsistencies here hurt everything that involves
the system call interface: all libcs, the kernel itself, strace etc.

    -hpa

  reply	other threads:[~2009-02-03 20:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-02 21:35 + preadv-pwritev-add-preadv-and-pwritev-system-calls.patch added to -mm tree akpm
     [not found] ` <200902022135.n12LZa1a010673-AB4EexQrvXRQetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2009-02-02 21:50   ` H. Peter Anvin
     [not found]     ` <49876A91.4000705-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2009-02-03 10:14       ` Gerd Hoffmann
     [not found]         ` <49881904.30705-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-02-03 17:06           ` H. Peter Anvin
     [not found]             ` <498879B3.8030002-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2009-02-03 17:15               ` Russell King
     [not found]                 ` <20090203171559.GA20898-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-02-03 17:29                   ` H. Peter Anvin
     [not found]                     ` <49887EF4.1090300-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2009-02-03 17:42                       ` Russell King
2009-02-03 20:19                         ` H. Peter Anvin [this message]
2009-02-05  0:42                         ` H. Peter Anvin
2009-02-02 21:51 ` H. Peter Anvin

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=f8847f63cb4945a447b11df7706754a7.squirrel@www.zytor.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=kraxel@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger \
    --cc=mm-commits@vger.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).