public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Markus Gutschke <markus@google.com>
Cc: linux-kernel@vger.kernel.org, dkegel@google.com
Subject: Re: [PATCH 1/1] x86: Make _syscallX() macros compile in PIC mode on i386
Date: Thu, 9 Mar 2006 19:22:32 -0800	[thread overview]
Message-ID: <20060309192232.2fd4767c.akpm@osdl.org> (raw)
In-Reply-To: <4410EC8A.4020808@google.com>

Markus Gutschke <markus@google.com> wrote:
>
> Andrew Morton wrote:
> > But we don't compile the kernel with -fpic...  We might want to, for kdump
> > convenience at some stage, perhaps.
> 
> Unless I am really confused, there should be no place in the kernel that 
> uses any of the _syscallX() macros. These macros are for the benefit of 
> userspace, and they get picked up by and distributed with glibc. They 
> just happen to be shipped and maintained with the kernel.

Nope, there's an int-80-based execve() implemented in
include/asm-i386/unistd.h.  It's called from init/do_mounts_initrd.c
and kernel/kmod.c (at least).

> > If we do, it'd be better to simply replace those _syscallX functions with
> > versions which work in either mode, rather than having two versions.
> 
> That is certainly possible. The new macros work in both modes, but they 
> are slightly less efficient than the old macros, if you have access to 
> %ebx (i.e. in non-PIC code). If you prefer, we could just remove the old 
> macros and unconditionally replace them with the new ones.

I'd be OK with that - the kernel doesn't (shouldn't) care about the
performance of __KERNEL_SYSCALLS__ stuff.  I doubt if glibc is borrowing
the kernel's macros.

> > The syscallX() macros are almost obsolete - it's preferred that code simply
> > include syscalls.h and call sys_foo() directly.  But there are a few
> > hard-to-convert places, iirc.
> 
> Are you thinking of the code that jumps through the vdso entry point? 
> That is not always an easy option for user-space applications which need 
> to remain backwards compatible to older versions of the kernel and of libc.
> 

afaik, execve() is the only reason for retaining __KERNEL_SYSCALLS__
support on x86.

  reply	other threads:[~2006-03-10  3:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-09 23:33 [PATCH 1/1] x86: Make _syscallX() macros compile in PIC mode on i386 Markus Gutschke
2006-03-10  2:47 ` Andrew Morton
2006-03-10  3:03   ` Markus Gutschke
2006-03-10  3:22     ` Andrew Morton [this message]
2006-03-10  3:36       ` dkegel
2006-03-10 23:40         ` Daniel Jacobowitz
2006-03-10 23:53           ` dkegel
2006-03-10 22:42       ` [PATCH 1/1] x86: Make _syscallX() macros compile in PIC mode on i386 (updated patch) Markus Gutschke
2006-03-10 23:02         ` dkegel
2006-03-11  0:05       ` [PATCH 1/1] x86: Make _syscallX() macros compile in PIC mode on i386 Arnd Bergmann
2006-03-10 14:37   ` Jan Engelhardt

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=20060309192232.2fd4767c.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=dkegel@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus@google.com \
    /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