Chandler Carruth via llvm-dev
2018-Jan-04 17:52 UTC
[llvm-dev] FYI, we've posted a component of Spectre mitigation on llvm-commits
On Thu, Jan 4, 2018 at 12:31 PM Stephen Checkoway via llvm-dev < llvm-dev at lists.llvm.org> wrote:> > > On Jan 4, 2018, at 04:23, Chandler Carruth via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > > > Sending a note here as this seems likely to be of relatively broad > interest. > > It looks like this is producing code of the following form. > > call next > loop: > pause > jmp loop > next: > mov [rsp], r11 > ret > > As I understand it, the busy loop is to cause the speculative execution to > be trapped in the loop. Was something like ud2 considered? I presume that > would stop the speculative execution without involving any of the execution > units the way the busy loop does. >The pause instruction will also avoid tying up execution resources in speculative contexts, so I wouldn't expect it to be significantly different.> > -- > Stephen Checkoway > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180104/e51f6309/attachment.html>
Stephen Checkoway via llvm-dev
2018-Jan-04 18:05 UTC
[llvm-dev] FYI, we've posted a component of Spectre mitigation on llvm-commits
On Jan 4, 2018, at 11:52, Chandler Carruth via llvm-dev <llvm-dev at lists.llvm.org> wrote:> On Thu, Jan 4, 2018 at 12:31 PM Stephen Checkoway via llvm-dev <llvm-dev at lists.llvm.org> wrote: > >> As I understand it, the busy loop is to cause the speculative execution to be trapped in the loop. Was something like ud2 considered? I presume that would stop the speculative execution without involving any of the execution units the way the busy loop does. >> > The pause instruction will also avoid tying up execution resources in speculative contexts, so I wouldn't expect it to be significantly different.Got it. The Software Developer Manual isn't entirely clear on this point (to me at least) and IACA shows a number of ports in use during the 4 or 5 Uops pause takes. Thank you, Steve -- Stephen Checkoway
Chandler Carruth via llvm-dev
2018-Jan-04 18:21 UTC
[llvm-dev] FYI, we've posted a component of Spectre mitigation on llvm-commits
On Thu, Jan 4, 2018 at 1:05 PM Stephen Checkoway via llvm-dev < llvm-dev at lists.llvm.org> wrote:> > On Jan 4, 2018, at 11:52, Chandler Carruth via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > > On Thu, Jan 4, 2018 at 12:31 PM Stephen Checkoway via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > > >> As I understand it, the busy loop is to cause the speculative execution > to be trapped in the loop. Was something like ud2 considered? I presume > that would stop the speculative execution without involving any of the > execution units the way the busy loop does. > >> > > The pause instruction will also avoid tying up execution resources in > speculative contexts, so I wouldn't expect it to be significantly different. > > Got it. The Software Developer Manual isn't entirely clear on this point > (to me at least) and IACA shows a number of ports in use during the 4 or 5 > Uops pause takes. >That's if it executes. But pause doesn't get speculatively executed at all. Sadly, this makes IACA and other tools challenging to use. Instead you want to construct a tight careful benchmark, control frequency and everything else, and look at exact retire rates of instructions etc. But if you find instruction sequences that reliably benchmark as faster, please share this on the review thread. =D> > Thank you, > > Steve > > -- > Stephen Checkoway > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180104/68b6fbaf/attachment.html>
Maybe Matching Threads
- FYI, we've posted a component of Spectre mitigation on llvm-commits
- FYI, we've posted a component of Spectre mitigation on llvm-commits
- FYI, we've posted a component of Spectre mitigation on llvm-commits
- FYI, we've posted a component of Spectre mitigation on llvm-commits
- FYI, we've posted a component of Spectre mitigation on llvm-commits