Linux-arch Archive on lore.kernel.org
 help / color / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH v2] Add preadv and pwritev system calls.
Date: Fri, 12 Dec 2008 08:29:29 -0700
Message-ID: <20081212152929.GM26095@parisc-linux.org> (raw)
In-Reply-To: <1229090440-32120-1-git-send-email-kraxel@redhat.com>

On Fri, Dec 12, 2008 at 03:00:40PM +0100, Gerd Hoffmann wrote:
> The patch sports the actual system call implementation and the windup in
> the x86 system call tables.  Other archs are TBD.

> +asmlinkage ssize_t sys_preadv(unsigned long fd, const struct iovec __user *vec,
> +                              unsigned long vlen, loff_t pos)
> +asmlinkage ssize_t sys_pwritev(unsigned long fd, const struct iovec __user *vec,
> +                               unsigned long vlen, loff_t pos)

Are these prototypes required?  MIPS and PARISC will need wrappers to
fix them if they are.  These two architectures have an ABI which
requires 64-bit arguments to be passed in aligned pairs of registers,
but glibc doesn't know that (and given the existence of syscall(3),
can't do much about it even if it knew), so some of the arguments end up
in the wrong registers.

Things will go much better if we can prototype these as:

asmlinkage ssize_t sys_preadv(unsigned int fd, const struct iovec __user *vec,
				loff_t pos, unsigned long vlen);
asmlinkage ssize_t sys_pwritev(unsigned int fd, const struct iovec __user *vec,
				loff_t pos, unsigned long vlen);

That way 'pos' ends up split between arg2 and arg3 and vlen ends up in
arg4 instead of having vlen in arg2 and pos in arg3 and arg4 which then
have to be munged to be in arg4 and arg5 by a compat wrapper.

I seem to recall the s390 folks having some concerns with this kind of
thing too, but I forget what they are, so I'll let them weigh in on
this.

By the way, why did you make 'fd' an unsigned long?  The rest of the
kernel uses unsigned int.

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply index

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-12 14:00 Gerd Hoffmann
2008-12-12 15:29 ` Matthew Wilcox [this message]
2008-12-12 15:48   ` Gerd Hoffmann
2008-12-12 15:51     ` Matthew Wilcox
2008-12-12 16:02       ` Gerd Hoffmann
2008-12-12 17:03         ` Matthew Wilcox
2008-12-12 17:03           ` Matthew Wilcox
2008-12-12 18:21           ` Alan Cox
2008-12-12 19:02             ` Russell King
2008-12-12 18:29         ` Scott Lurndal
2008-12-12 19:07           ` Russell King
2008-12-12 19:56             ` Gerd Hoffmann
2008-12-12 19:56               ` Gerd Hoffmann
2008-12-12 20:12               ` Russell King
2008-12-12 20:12                 ` Russell King
2008-12-12 20:39                 ` Gerd Hoffmann
2008-12-12 20:39                   ` Gerd Hoffmann
2008-12-14 18:19               ` Pavel Machek
2008-12-14 18:19                 ` Pavel Machek
2008-12-15 16:37         ` Jennifer Pioch
2008-12-15 20:43           ` Gerd Hoffmann
2008-12-16  9:57             ` Arnd Bergmann
     [not found]               ` <200812161057.03025.arnd-r2nGTMty4D4@public.gmane.org>
2008-12-17  1:45                 ` Dan Mick
2008-12-17  1:45                   ` [osol-code] " Dan Mick
2008-12-12 19:47   ` Arnd Bergmann
2008-12-12 20:02     ` Gerd Hoffmann
2008-12-14 11:49   ` Heiko Carstens
2008-12-15  4:14   ` Paul Mackerras
2008-12-15  6:20     ` David Miller
2008-12-12 15:40 ` Ralf Baechle
2008-12-12 16:59 ` Russell King
2008-12-13  1:18 ` Michael Kerrisk

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=20081212152929.GM26095@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=kraxel@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@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

Linux-arch Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arch/0 linux-arch/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arch linux-arch/ https://lore.kernel.org/linux-arch \
		linux-arch@vger.kernel.org
	public-inbox-index linux-arch

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arch


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git