linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"H.J. Lu" <hjl.tools@gmail.com>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: RFD: x32 ABI system call numbers
Date: Fri, 26 Aug 2011 17:36:35 -0700	[thread overview]
Message-ID: <CA+55aFxdRMxWLh1B_8v29qFafM425uH7kbYRfqoPe3TpVwOx-w@mail.gmail.com> (raw)
In-Reply-To: <4E582EAA.1040108@zytor.com>

On Fri, Aug 26, 2011 at 4:39 PM, H. Peter Anvin <hpa@zytor.com> wrote:
> On 08/26/2011 04:13 PM, Linus Torvalds wrote:
>>
>>  - why do we need another system call model at all?
>
> We think we can get more performance for a process which doesn't need
> more than 4 GiB of virtual address space by allowing them to keep
> pointers 4 bytes long, while still giving them the advantage of 16
> 64-bit registers, PC-relative addressing, and so on.  Furthermore, there
> are users who seem more willing to port code known to not be 64-bit
> clean to x32 than to do a whole new port.

Let me repeat: what the f*&% does that have to do with a new system call model?

NOTHING.

At most, it means that we should add a PROT_4G to the mmap() system
call, so that user space can say "I want the result in the low 4G"
range. But even that wouldn't need a new system call.

> If the question is "why not just thunk this in userspace", the answer is
> that we'd like to take advantage of the compat layer already in the kernel.

And you *still* don't answer the question, you just make up new red
herring sentences.

Apart from mmap() (and to a lesser degree brk()), the kernel almost
never makes up user pointers. It's user space that points to them, and
gives them as arguments. There'sa few system calls that take pointers
to pointers: execve(), readv/writev, send/recvmsg, but then the actual
*example* you give isn't even one of those.

> If the question is "why not just use int $0x80" we actually did that in
> early prototyping, but SYSCALL64 is much faster.

No. The actual question is "why are you giving crazy examples, and
what the f*ck is going on"?

> sys_stat is unshared because it involves data structures in memory.  In
> x32, this invokes compat_sys_newstat just like you would from an i386
> process.

.. and this is exactly the kind of answer that makes me go NAK NAK NAK.

Christ no.

If you are doing a new native x32 model, then you DAMN WELL USE THE
EXISTING "stat()" system call.

There is *ZERO* reason to not use it. Use the standard 64-bit
structure layout. Why the hell would it be a new system call?

That's what I'm arguing against. This kind of crazy "let's make up YET
ANOTHER interface, even though the existing interface would work".
WHY?

If you want to be compatible with "int 0x80" and old libraries, then I
really don't see why you would introduce *anything* new.

And if it is truly a new ABI, then damn it, use the existing 64-bit
system calls as far as possible.

The "mix and match randomly and then introduce new system calls
because you made a bad design decision" sounds just crazy.

                              Linus

  reply	other threads:[~2011-08-27  0:37 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26 23:00 RFD: x32 ABI system call numbers H. Peter Anvin
2011-08-26 23:13 ` Linus Torvalds
2011-08-26 23:39   ` H. Peter Anvin
2011-08-27  0:36     ` Linus Torvalds [this message]
2011-08-27  0:43       ` Linus Torvalds
2011-08-27  0:53         ` H. Peter Anvin
2011-08-27  1:18           ` Linus Torvalds
2011-08-27  1:35             ` H. Peter Anvin
2011-08-27  1:45               ` Linus Torvalds
2011-08-27  1:12         ` H. Peter Anvin
2011-08-27  1:42           ` Linus Torvalds
2011-08-29 19:01             ` Geert Uytterhoeven
2011-08-29 19:03               ` H. Peter Anvin
2011-08-30  1:17               ` Ted Ts'o
2011-08-30  1:48               ` Linus Torvalds
2011-08-30  2:16                 ` Kyle Moffett
2011-08-30  4:45                   ` H. Peter Anvin
2011-08-30  7:06                     ` Geert Uytterhoeven
2011-08-30 12:18                       ` Arnd Bergmann
2011-08-30  7:09                   ` Andi Kleen
2011-08-30  9:56                     ` Alan Cox
2011-08-30  7:00                 ` Geert Uytterhoeven
2011-09-20 18:37                   ` Jan Engelhardt
2011-09-06 20:40         ` Florian Weimer
2011-08-27  0:57       ` H. Peter Anvin
2011-08-27  4:40         ` Christoph Hellwig
2011-08-29 15:04           ` Arnd Bergmann
2011-08-29 18:31             ` H. Peter Anvin
2011-08-30 12:09               ` Arnd Bergmann
2011-08-30 16:35                 ` H. Peter Anvin
2011-08-31 16:14                   ` Arnd Bergmann
2011-08-31 16:25                     ` H. Peter Anvin
2011-08-31 16:39                       ` Arnd Bergmann
2011-08-31 16:48                         ` Linus Torvalds
2011-08-31 19:18                           ` Arnd Bergmann
2011-08-31 19:44                             ` H. Peter Anvin
2011-08-31 19:54                               ` Alan Cox
2011-08-31 20:02                                 ` H. Peter Anvin
2011-08-31 20:55                                   ` Arnd Bergmann
2011-08-31 20:58                                     ` H. Peter Anvin
2011-08-31 19:49                             ` Geert Uytterhoeven
2011-08-31 16:46                     ` Linus Torvalds
2011-08-31 17:05                       ` H.J. Lu
2011-09-03  2:56                         ` H.J. Lu
2011-09-03  3:04                           ` Linus Torvalds
2011-09-03  4:02                             ` H.J. Lu
2011-09-03  4:29                               ` H. Peter Anvin
2011-09-03  4:44                                 ` H.J. Lu
2011-09-03  5:16                                   ` H. Peter Anvin
2011-09-03 14:11                                     ` H.J. Lu
2011-09-03  5:29                                   ` H. Peter Anvin
2011-09-03  8:41                                     ` Arnd Bergmann
2011-09-03 14:04                                       ` Valdis.Kletnieks
2011-09-03 16:40                                         ` H. Peter Anvin
2011-09-03 17:16                                           ` Valdis.Kletnieks
2011-09-03 17:22                                             ` H.J. Lu
2011-09-03 17:28                                               ` H. Peter Anvin
2011-09-03 17:27                                             ` H. Peter Anvin
2011-09-04 13:51                                               ` Valdis.Kletnieks
2011-09-04 15:17                                               ` Arnd Bergmann
2011-09-04 17:08                                                 ` Linus Torvalds
2011-09-04 18:40                                                 ` H.J. Lu
2011-09-04 19:06                                                   ` Arnd Bergmann
2011-09-04 19:31                                                     ` H.J. Lu
2011-09-04 21:13                                                       ` Arnd Bergmann
2011-09-04 21:25                                                         ` H.J. Lu
2011-09-04 21:41                                                           ` Arnd Bergmann
2011-09-04 22:13                                                             ` H.J. Lu
2011-09-05  7:48                                                               ` Arnd Bergmann
2011-09-05 15:11                                                                 ` H.J. Lu
2011-09-05 17:21                                                                   ` Arnd Bergmann
2011-09-05 19:34                                                                     ` H.J. Lu
2011-09-05 19:54                                                                       ` H.J. Lu
2011-09-05 19:59                                                                         ` H. Peter Anvin
2011-09-05 20:27                                                                           ` Arnd Bergmann
2011-09-09 21:02                                                                   ` H.J. Lu
2011-09-04 20:11                                                     ` H. Peter Anvin
2011-09-04 19:31                                                   ` richard -rw- weinberger
2011-09-04 19:32                                                     ` H.J. Lu
2011-09-03 14:15                                     ` H.J. Lu
2011-08-31 17:09                       ` H. Peter Anvin
2011-08-31 17:19                         ` Linus Torvalds
2011-08-31 17:38                           ` H. Peter Anvin
2011-09-01 11:35                             ` Arnd Bergmann
2011-10-01 19:38                               ` Jonas Bonn
2012-02-08 21:36                           ` 64-bit time on 32-bit systems H. Peter Anvin
2011-09-01 13:30                         ` RFD: x32 ABI system call numbers Avi Kivity
2011-09-01 14:13                           ` H. Peter Anvin
2011-09-02  0:49                             ` Pedro Alves
2011-09-02  1:51                               ` H. Peter Anvin
2011-09-02  8:02                                 ` Arnd Bergmann
2011-09-02  8:42                                 ` Pedro Alves
2011-09-01  6:08                     ` Jonas Bonn
2011-09-02  6:17     ` Andy Lutomirski

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=CA+55aFxdRMxWLh1B_8v29qFafM425uH7kbYRfqoPe3TpVwOx-w@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=hjl.tools@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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).