Bug 151453 - vdso should use AMD syscall
Summary: vdso should use AMD syscall
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: i686
OS: Linux
medium
low
Target Milestone: ---
Assignee: Roland McGrath
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On: 151450
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-18 02:40 UTC by Roland McGrath
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-02 10:10:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Roland McGrath 2005-03-18 02:40:10 UTC
AMD processors have the `syscall' and `sysret' instructions, which are like
Intel's sysenter/sysexit but with fewer problems.  Firstly, the upstream kernel
should get changes to support syscall/sysret for AMD processors.  Then we will
need to modify these for exec-shield support.

See bug #151452 for related issues with exec-shield (not an issue for upstream).
 syscall/sysret only has one of those problems, not both.

First we should try using syscall and not using sysret, which may have a
performance improvement vs using int.

The issue is conflicts with cs segment limits used by exec-shield.
sysret cannot be used when cs segment limits are being used.  But, newer
processors have NX support and do not need to use segment limits.
We should conditionalize sysret use on that.

Comment 1 Dave Jones 2005-10-06 05:12:45 UTC
We already do the conditionalisation (is that a word? it is now!) on NX, and
that works fine afaik.

syscall support however is indeed still lacking (at least for ia32). I thought I
read that sysexit also resets segment limits, but I could be misremembering. 
The thread on lkml when Linus first did the sysenter support did touch on this
briefly iirc.  I'll see if I can dig it out.


Comment 2 Roland McGrath 2005-10-06 08:21:15 UTC
sysenter also resets to flat segments, yes.  That's why it's disabled when using
segment limits for execute protection (i.e. no NX).  The only issue is the extra
entrypoint flavor for syscall on AMD 32-bit.  But since we only enable it for NX
(upstream doesn't constrain it, since no exec-shield), I don't think it's worth
bothering.  I'm not sure, but I think that maybe all the AMD chips that support
NX also support sysenter (though older AMD chips only support syscall). 

Comment 3 Roland McGrath 2006-03-02 10:10:02 UTC
Not worth worrying about.  Someone upstream might decide to optimize old AMD chips.


Note You need to log in before you can comment on or make changes to this bug.