This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/5] x86: Add -mindirect-branch-loop=


* H. J. Lu:

> On Mon, Jan 8, 2018 at 12:20 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
>> * H. J. Lu:
>>
>>> Add -mindirect-branch-loop= option to control loop filler in call and
>>> return thunks generated by -mindirect-branch=.  'lfence' uses "lfence"
>>> as loop filler.  'pause' uses "pause" as loop filler.  'nop' uses "nop"
>>> as loop filler.  The default is 'lfence'.
>>
>> Why is the loop needed?  Doesn't ud2 or cpuid stop speculative
>> execution?
>
> My understanding is that a loop works better.

Better how?

What about far jumps?  I think they prevent some forms of prefetch on
i386, so perhaps long mode is similar in that regard?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]