lkml.org 
[lkml]   [2014]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 1/2] x86_64,entry: Filter RFLAGS.NT on entry from userspace
On Tue, Sep 30, 2014 at 10:09 PM, Sebastian Lackner
<sebastian@fds-team.de> wrote:
>> + testl $X86_EFLAGS_NT,EFLAGS(%rsp) /* saved EFLAGS match cpu */
>> + jz 1f
>> + pushq_cfi $(X86_EFLAGS_IF|X86_EFLAGS_FIXED)
>> + popfq_cfi
>> +1:
>> +
>
> Do you think it makes sense to change the order here, so that no jump happens if
> NT is not set (which happens a bit more often, than the other way round)? Just a
> guess though, haven't measured if pipeline effects have such a big influence in this
> case. ;)
>

It should be immeasurable in a tight loop, since it will predict
correctly almost every time. And, unless cfi state works across
.pushsection (does it?), getting the cfi annotations right will be
more complicated.

--Andy

--
Andy Lutomirski
AMA Capital Management, LLC


\
 
 \ /
  Last update: 2014-10-01 08:01    [W:0.076 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site