public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [GIT PULL] x86/asm changes for v2.6.37
Date: Thu, 21 Oct 2010 13:22:24 -0700	[thread overview]
Message-ID: <4CC0A100.20208@zytor.com> (raw)
In-Reply-To: <AANLkTimLCHhh1TmfpOeju6RcxbCMreh7yQKTZvFj87aF@mail.gmail.com>

On 10/21/2010 01:16 PM, Linus Torvalds wrote:
> On Thu, Oct 21, 2010 at 6:21 AM, Ingo Molnar <mingo@elte.hu> wrote:
>>
>> Jan Beulich (1):
>>      i386: Make kernel_execve() suitable for stack unwinding
>>
>>        long __res;
>> -       asm volatile ("push %%ebx ; movl %2,%%ebx ; int $0x80 ; pop %%ebx"
>> +       asm volatile ("int $0x80"
>>        : "=a" (__res)
>> -       : "0" (__NR_execve), "ri" (filename), "c" (argv), "d" (envp) : "memory");
>> +       : "0" (__NR_execve), "b" (filename), "c" (argv), "d" (envp) : "memory");
>>        return __res;
>>  }
> 
> I pulled this, but there's a reason we used to do it that way - gcc
> has had bugs with inline asm changing %ebx due to some bad interaction
> with using it as the GOT base register for position-independent code
> or something.
> 
> So I hope those are all solved, and I guess we use -fPIC only for some
> early boot code. But in case this is ever used in some environment
> that is PIC (the vsyscall page?) we need to worry about gcc
> interactions.
> 

We used to allow these macros to be used from user space; we don't
anymore.  The vsyscall page is PIC, but we wouldn't be calling
kernel_execve() from there.

The good part is that gcc will fail to compile if we ever violate the
assumptions; we won't see quiet failures.

	-hpa

      reply	other threads:[~2010-10-21 20:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-21 13:21 [GIT PULL] x86/asm changes for v2.6.37 Ingo Molnar
2010-10-21 20:16 ` Linus Torvalds
2010-10-21 20:22   ` H. Peter Anvin [this message]

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=4CC0A100.20208@zytor.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox