Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1352829

Re: [PATCH] x86/entry: Improve system call entry comments

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] x86/entry: Improve system call entry comments
Date 2016-03-08 11:30 +0100
Message-ID <ran3P-80x-1@gated-at.bofh.it> (permalink)
References <r9KYy-8f9-3@gated-at.bofh.it> <r9YI9-oh-9@gated-at.bofh.it> <ra6Pp-5Ig-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] x86/entry: Improve system call entry comments Andy Lutomirski <luto@kernel.org> - 2016-03-06 18:50 +0100
  Re: [PATCH] x86/entry: Improve system call entry comments Ingo Molnar <mingo@kernel.org> - 2016-03-07 09:30 +0100
    Re: [PATCH] x86/entry: Improve system call entry comments "H. Peter Anvin" <hpa@zytor.com> - 2016-03-07 17:40 +0100
      Re: [PATCH] x86/entry: Improve system call entry comments Ingo Molnar <mingo@kernel.org> - 2016-03-08 11:40 +0100
        Re: [PATCH] x86/entry: Improve system call entry comments "H. Peter Anvin" <hpa@zytor.com> - 2016-03-08 19:50 +0100
          Re: [PATCH] x86/entry: Improve system call entry comments Andy Lutomirski <luto@amacapital.net> - 2016-03-08 20:00 +0100
            Re: [PATCH] x86/entry: Improve system call entry comments "H. Peter Anvin" <hpa@zytor.com> - 2016-03-08 20:10 +0100
              Re: [PATCH] x86/entry: Improve system call entry comments Andy Lutomirski <luto@amacapital.net> - 2016-03-08 20:20 +0100
        Re: [PATCH] x86/entry: Improve system call entry comments "H. Peter Anvin" <hpa@zytor.com> - 2016-03-08 19:50 +0100
          Re: [PATCH] x86/entry: Improve system call entry comments Andy Lutomirski <luto@amacapital.net> - 2016-03-08 19:50 +0100
    Re: [PATCH] x86/entry: Improve system call entry comments Andy Lutomirski <luto@amacapital.net> - 2016-03-07 18:10 +0100
      Re: [PATCH] x86/entry: Improve system call entry comments Ingo Molnar <mingo@kernel.org> - 2016-03-08 11:30 +0100
        Re: [PATCH] x86/entry: Improve system call entry comments Andy Lutomirski <luto@amacapital.net> - 2016-03-08 19:40 +0100

csiph-web