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

David Woodhouse dwmw2@infradead.org
Sat Jan 13 09:03:00 GMT 2018


On Sat, 2018-01-13 at 03:11 +0000, Kumar, Venkataramanan wrote:
> 
> > My original patch uses "lfence".  I was asked to use "pause":
>> > https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00969.html
> 
> If everyone is ok, my suggestion is to use  "lfence" as the default
> loop filler for retpoline.
> 
> Please confirm.

I have had the same request for the kernel patches. I'm happy with it
but would like confirmation from Intel and from Paul Turner (whose idea
this is, and who has overseen most of the coherent analysis).

FWIW I haven't actually *changed* the kernel patch yet, awaiting that
confirmation. I understand this is a power optimisation only;
preventing the CPU from spinning in that loop when it's mispredicted a
return to it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5213 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180113/73d062e4/attachment.bin>


More information about the Gcc-patches mailing list