Bug 151453

Summary: vdso should use AMD syscall
Product: [Fedora] Fedora Reporter: Roland McGrath <roland>
Component: kernelAssignee: Roland McGrath <roland>
Status: CLOSED UPSTREAM QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: medium    
Version: rawhideCC: mingo, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-02 10:10:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 151450    
Bug Blocks:    

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.