[PATCH] D44824: [Spectre] Introduce a new pass to do speculative load hardening to mitigate Spectre variant #1 for x86.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 12 02:57:25 PDT 2018


chandlerc updated this revision to Diff 155140.
chandlerc added a comment.

Rebase on top of https://reviews.llvm.org/D49220 and add some more basic testing:

- Conditions, merges, address hardening, post-load hardening
- Loops, nested loops
- Invokes and landing pads

Also worked on the tests ta get reasonable generated checks. I think we want
generated checks here because this pass is all about the very detailed
instruction sequence produced for these patterns.

I can add a bit more testing, but everything will look mostly like this. There
isn't *that* much variation left. The biggest thing I can add is some testing
with more contended EFLAGS, but a lot of the logic there is now really simple
in SLH and handled (and tested) in the flags copy lowering.

Generally, I think this is ready for more detailed review. I'll update with
fixes to the few minor comments next, and then I'll work on some more test
coverage.

I have a collection of refactorings in mind. I'm happy to do those whenever
makes sense -- immediately, after a round of review, or in a follow-up commit.


Repository:
  rL LLVM

https://reviews.llvm.org/D44824

Files:
  llvm/docs/SpeculativeLoadHardening.md
  llvm/docs/speculative_load_hardening_microbenchmarks.png
  llvm/include/llvm/CodeGen/MachineBasicBlock.h
  llvm/lib/CodeGen/MachineBasicBlock.cpp
  llvm/lib/CodeGen/RegisterCoalescer.cpp
  llvm/lib/Target/X86/CMakeLists.txt
  llvm/lib/Target/X86/LLVMBuild.txt
  llvm/lib/Target/X86/X86.h
  llvm/lib/Target/X86/X86InstrInfo.h
  llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/CodeGen/X86/speculative-load-hardening.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44824.155140.patch
Type: text/x-patch
Size: 138533 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180712/0aa61424/attachment.bin>


More information about the llvm-commits mailing list