From: Bart Hartgers <bart@etpmod.phys.tue.nl>
To: "linux-os (Dick Johnson)" <linux-os@analogic.com>
Cc: Tomasz Malesinski <tmal@mimuw.edu.pl>, Andi Kleen <ak@suse.de>,
linux-kernel@vger.kernel.org
Subject: Re: Segfault on the i386 enter instruction
Date: Mon, 15 May 2006 16:19:08 +0200 [thread overview]
Message-ID: <44688DDC.3020605@etpmod.phys.tue.nl> (raw)
In-Reply-To: <Pine.LNX.4.61.0605150933060.22830@chaos.analogic.com>
linux-os (Dick Johnson) wrote:
> On Mon, 15 May 2006, Bart Hartgers wrote:
>
>> Tomasz Malesinski wrote:
>>> On Fri, May 12, 2006 at 03:50:20PM +0200, Andi Kleen wrote:
>>>> Handling it like you expect would require to disassemble
>>>> the function in the page fault handler and it's probably not
>>>> worth doing that for this weird case.
>>> Does it mean that the ENTER instruction should not be used to create
>>> stack frames in Linux programs?
>>>
>> Basically, yes. Here is a link to a relevant discussion in the 2.2.7 era:
>>
>> http://groups.google.co.nz/groups?selm=7i86ni%24b7n%241%40palladium.transmeta.com
>>
>> And perhaps x86-64 is handled different because of the red zone (some
>> memory below the stack-pointer that can be accessed legally)?
>>
>> Groeten,
>> Bart
>
> The enter instruction works perfectly fine. The processors were
> designed to use both enter and leave. There are no prohibitions
> against their use. It's just that if you play games with assembly
> so you create a stack-pointer wrap situation, you can get a
> bounds error.
No. The assembly is fine. Also enter does what it is supposed to do. The
problem is that enter can cause a pagefault on an address (far) below
the %esp, and Linu[xs] considers that an error (for good reasons).
Groeten,
Bart
--
Bart Hartgers - TUE Eindhoven - http://plasimo.phys.tue.nl/bart/contact/
next prev parent reply other threads:[~2006-05-15 14:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-12 13:16 Segfault on the i386 enter instruction Tomasz Malesinski
2006-05-12 13:47 ` Denis Vlasenko
2006-05-12 13:50 ` Andi Kleen
2006-05-12 14:03 ` Denis Vlasenko
2006-05-12 15:31 ` Tomasz Malesinski
2006-05-15 11:36 ` Bart Hartgers
2006-05-15 11:46 ` Andi Kleen
2006-05-15 13:36 ` linux-os (Dick Johnson)
2006-05-15 14:19 ` Bart Hartgers [this message]
2006-05-12 14:07 ` linux-os (Dick Johnson)
2006-05-12 14:20 ` Denis Vlasenko
2006-05-12 14:42 ` linux-os (Dick Johnson)
2006-05-12 14:53 ` Denis Vlasenko
2006-05-15 20:53 ` Bill Davidsen
-- strict thread matches above, loose matches on Subject: below --
2006-05-14 17:56 Stas Sergeev
2006-05-15 7:40 ` Andi Kleen
2006-05-15 17:15 ` Stas Sergeev
2006-05-15 18:44 ` Andi Kleen
2006-05-15 19:38 ` Stas Sergeev
2006-05-15 19:56 ` Lee Revell
2006-05-15 22:49 ` Ingo Oeser
2006-05-15 22:56 ` Lee Revell
2006-05-16 2:29 Chuck Ebbert
2006-05-16 9:32 ` Andi Kleen
2006-05-17 8:20 Chuck Ebbert
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=44688DDC.3020605@etpmod.phys.tue.nl \
--to=bart@etpmod.phys.tue.nl \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-os@analogic.com \
--cc=tmal@mimuw.edu.pl \
/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