Trampolines on x86

View: New views
5 Messages — Rating Filter:   Alert me  

Trampolines on x86

by Tonnerre LOMBARD-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Salut,

Lars and me encountered a number of problems with iret and trampolines
on x86. Therefor, we wondered of what use trampolines still are on
x86 (i386 and amd64) are these days. Considering the fact that we're
using lazy mapping tricks, wouldn't the trampoline be more of a
performance drain than the gain it originally intented?

In order to solve the bug we're currently tracing, we would need to
add special handling code to the iret operation which would make the
regular trampoline code slower. In order to avoid hitting this in
future NetBSD releases, we'd like to disable trampolines entirely.
Compat code however would retain them (obviously) and run slower.

Are there any thoughts or objections on this?

                                Tonnerre


attachment0 (849 bytes) Download Attachment

Re: Trampolines on x86

by Christos Zoulas-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In article <20091031152656.GF23079@...>,
Tonnerre Lombard  <tonnerre@...> wrote:

>-=-=-=-=-=-
>
>Salut,
>
>Lars and me encountered a number of problems with iret and trampolines
>on x86. Therefor, we wondered of what use trampolines still are on
>x86 (i386 and amd64) are these days. Considering the fact that we're
>using lazy mapping tricks, wouldn't the trampoline be more of a
>performance drain than the gain it originally intented?
>
>In order to solve the bug we're currently tracing, we would need to
>add special handling code to the iret operation which would make the
>regular trampoline code slower. In order to avoid hitting this in
>future NetBSD releases, we'd like to disable trampolines entirely.
>Compat code however would retain them (obviously) and run slower.
>
>Are there any thoughts or objections on this?

This could be done only for images that have executable stack, so it
should not affect regular binaries. And there is always objective c.

christos


Re: Trampolines on x86

by David Laight :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Oct 31, 2009 at 04:26:56PM +0100, Tonnerre Lombard wrote:
> Salut,
>
> Lars and me encountered a number of problems with iret and trampolines
> on x86. Therefor, we wondered of what use trampolines still are on
> x86 (i386 and amd64) are these days. Considering the fact that we're
> using lazy mapping tricks, wouldn't the trampoline be more of a
> performance drain than the gain it originally intented?

Which trampolines are you bouncing on ??

IIRC gcc uses on-stack tramoplines for fat function pointers.
Are there some others as well???

        David

--
David Laight: david@...

Re: Trampolines on x86

by Martin Husemann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Oct 31, 2009 at 04:26:56PM +0100, Tonnerre Lombard wrote:
> Lars and me encountered a number of problems with iret and trampolines
> on x86.

Sorry, I don't understand what "iret" and what "trampolines" you are
talking about (and since this is on tech-kern instead of port-x86 I
guess I'm not alone).

Could you please clarify?

Martin

Re: Trampolines on x86

by Michael Lorenz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Oct 31, 2009, at 12:55 PM, Martin Husemann wrote:

> On Sat, Oct 31, 2009 at 04:26:56PM +0100, Tonnerre Lombard wrote:
>> Lars and me encountered a number of problems with iret and  
>> trampolines
>> on x86.
>
> Sorry, I don't understand what "iret" and what "trampolines" you are
> talking about (and since this is on tech-kern instead of port-x86 I
> guess I'm not alone).

IRET is x86 speak for return from interrupt IIRC.

have fun
Michael

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQEVAwUBSuyShMpnzkX8Yg2nAQKTYAgAoteBvx7uQR6N483futyFdmWam0hAqkHf
IxbwySQNTTsvbC4Jg2WeuJq/qJhoeLqyBgGxDNovtdIRJ3x3QaVoJWdaXskij51M
YXknHN5vhk2mW8AJIXNIrs+KQA9MCa8LoiOZTxzqwERR7NjU/+WzroyKnY5zywB2
WTU3cYywt6X1AS2Bjcs4LgvLcJrrJX3ElXtyw9YrHWLVfaa8g+fNy+Iw6si0m0eN
6NCDWkgx/nBvDzSGnYUJO8aAsFRbeLStso8O/0W172zk09xcaTVK955HLFlUMvkq
DWSTVCrK4xyAFNDM2w0wznogdtjQetnV8BCRPSF4f7K69IbMkWZ1YQ==
=0z/C
-----END PGP SIGNATURE-----