All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Brian Gerst <brgerst@gmail.com>, "H. Peter Anvin" <hpa@zytor.com>,
	X86 ML <x86@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] x86/entry: Improve system call entry comments
Date: Tue, 8 Mar 2016 11:27:55 +0100	[thread overview]
Message-ID: <20160308102755.GA5407@gmail.com> (raw)
In-Reply-To: <CALCETrVo42mw6xd8an0F37A+cx-vPje0Xmgh0-coG7N1J7a8kA@mail.gmail.com>


* Andy Lutomirski <luto@amacapital.net> wrote:

> > >  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?
> >
> 
> 64-bit programs can and sometimes do trigger this entry point. [...]

How can 64-bit programs trigger entry_INT80_32? It's only ever set on 32-bit 
kernels:

#ifdef CONFIG_X86_32
        set_system_trap_gate(IA32_SYSCALL_VECTOR, entry_INT80_32);
        set_bit(IA32_SYSCALL_VECTOR, used_vectors);
#endif

> [...]  It does a 32-bit syscall regardless of the caller's bitness, but it 
> returns back to the caller's original context, whatever it was.

That's true of INT $0x80, but I'm talking about the entry point: AFAICS 
entry_INT80_32 can only ever execute on 32-bit kernels.

We don't even build the entry_32.S::entry_INT80_32 entry point on 64-bit kernels:

obj-y                           := entry_$(BITS).o [...]

> 
> > 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.)
> 
> I like the part in parentheses.

So the part in parentheses conflict with your above statement :)

What I wanted to say with this:

> > > + * 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.)

... is what it says: that entry_INT80_32 is only active on 32-bit kernels, running 
32-bit programs, performing 32-bit system calls.

Programs running on 64-bit kernels can use INT $0x80 as well, but will land on 
another, different, 64-bit kernel specific entry point.

What am I missing?

Thanks,

	Ingo

  reply	other threads:[~2016-03-08 10:28 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
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 [this message]
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=20160308102755.GA5407@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@amacapital.net \
    --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.