All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Andy Lutomirski <luto@kernel.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Borislav Petkov <bp@alien8.de>, Oleg Nesterov <oleg@redhat.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Brian Gerst <brgerst@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] x86/entry: Improve system call entry comments
Date: Mon, 7 Mar 2016 09:22:28 +0100	[thread overview]
Message-ID: <20160307082228.GA11026@gmail.com> (raw)
In-Reply-To: <3cc149b4ce9a108a092d816c5158808c62c557f0.1457285880.git.luto@kernel.org>


* Andy Lutomirski <luto@kernel.org> wrote:

> Ingo suggested that the comments should explain when the various
> entries are used.  This adds these explanations and improves other
> parts of the comments.

Thanks for doing this, this is really useful!

One very small detail I noticed:

> +/*
> + * 32-bit legacy system call entry.
> + *
> + * 32-bit x86 Linux system calls traditionally used the INT $0x80
> + * instruction.  INT $0x80 lands here.
> + *
> + * This entry point can be used by 32-bit and 64-bit programs to perform
> + * 32-bit system calls.  Instances of INT $0x80 can be found inline in
> + * various programs and libraries.  It is also used by the vDSO's
> + * __kernel_vsyscall fallback for hardware that doesn't support a faster
> + * entry method.  Restarted 32-bit system calls also fall back to INT
> + * $0x80 regardless of what instruction was originally used to do the
> + * system call.
> + *
> + * This is considered a slow path.  It is not used by modern libc
> + * implementations on modern hardware except during process startup.
> + *
> + * Arguments:
> + * eax  system call number
> + * ebx  arg1
> + * ecx  arg2
> + * edx  arg3
> + * esi  arg4
> + * edi  arg5
> + * ebp  arg6
> + */
>  ENTRY(entry_INT80_32)

entry_INT80_32() is only used on pure 32-bit kernels, 64-bit kernels use 
entry_INT80_compat(). So the above text should not talk about 64-bit programs, as 
they can never trigger this specific entry point, right?

So I'd change the explanation to something like:

> + * This entry point is active on 32-bit kernels and can thus be used by 32-bit 
> + * programs to perform 32-bit system calls. (Programs running on 64-bit
> + * kernels executing INT $0x80 will land on another entry point: 
> + * entry_INT80_compat. The ABI is identical.)

Agreed?

Thanks,

	Ingo

  reply	other threads:[~2016-03-07  8:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06 17:39 [PATCH] x86/entry: Improve system call entry comments Andy Lutomirski
2016-03-07  8:22 ` Ingo Molnar [this message]
2016-03-07 16:34   ` H. Peter Anvin
2016-03-08 10:30     ` Ingo Molnar
2016-03-08 18:40       ` H. Peter Anvin
2016-03-08 18:45         ` Andy Lutomirski
2016-03-08 18:47           ` H. Peter Anvin
2016-03-08 18:50             ` Andy Lutomirski
2016-03-08 18:59               ` H. Peter Anvin
2016-03-08 19:11                 ` Andy Lutomirski
2016-03-07 17:01   ` Andy Lutomirski
2016-03-08 10:27     ` Ingo Molnar
2016-03-08 18:29       ` 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=20160307082228.GA11026@gmail.com \
    --to=mingo@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=oleg@redhat.com \
    --cc=tglx@linutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.