Re: [PATCH] x86-64: espfix for 64-bit mode *PROTOTYPE*

H. Peter Anvin
2014-04-22T17:16:22Z

On 04/22/2014 10:11 AM, Andrew Lutomirski wrote:
>>
>> Anyway, if done correctly, this whole espfix should be totally free
>> for normal processes, since it should only trigger if SS is a LDT
>> entry (bit #2 set in the segment descriptor). So the normal fast-path
>> should just have a simple test for that.
>
> How? Doesn't something still need to check whether SS is funny before
> doing iret?
>

Ideally the tests should be doable such that on a normal machine the
tests can be overlapped with the other things we have to do on that
path. The exit branch will be strongly predicted in the negative
direction, so it shouldn't be a significant problem.

Again, this is not the case in the current prototype.

-hpa