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

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 24 16:45:28 PDT 2018


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

Rebase and update. Relevant changes here:

- Updated docs a bit to track changes in the live Google Doc. Added links to the MSVC LFENCE analysis and added explicit credit for one of the folks at HACS that helped come up with some of these ideas.
- Removed a bunch of flags that simply don't work now that the pass uses post-load hardening as heavily as it does. These mostly had to do with tricks to harden against even access low 2gb of memory. These tricks aren't compatible with a mask that can be used for post-load hardening. Plus they were pretty expensive. I had already removed them from the design document, but still had the code lying around and just not working as intended.
- Removed the flag for fixed address hardening. This doesn't actually work anyways for the same reason as above.
- Added FIXME text for one hole in the current approach around segmented addresses where we don't secure them as much as I would like. I'll probably just document that TLS data *also* cannot directly be used for secret data and be mitigated with this approach as we'll end up accessing fixed offsets of the TLS segment.
- Added options to disable the IP hardening technique. This is responsible for a surprising fraction of the overhead: as much as 10% in my rough measurements. Having this option makes it easy to measure such things.


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.cpp
  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.139730.patch
Type: text/x-patch
Size: 134973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180324/e8db642c/attachment.bin>


More information about the llvm-commits mailing list