Control-Flow Enforcement Technology - Shadow Stack support (LLVM side)
authorOren Ben Simhon <oren.ben.simhon@intel.com>
Sun, 26 Nov 2017 13:02:45 +0000 (13:02 +0000)
committerOren Ben Simhon <oren.ben.simhon@intel.com>
Sun, 26 Nov 2017 13:02:45 +0000 (13:02 +0000)
commitfa582b075c4762829eea59444624c9d90e6b1113
treeace7d05b3f111e55b451061d5b61cfd34b3340aa
parentfec21ec0c6257eb24290c483b03b4fd9e6a9d0d1
Control-Flow Enforcement Technology - Shadow Stack support (LLVM side)

Shadow stack solution introduces a new stack for return addresses only.
The HW has a Shadow Stack Pointer (SSP) that points to the next return address.
If we return to a different address, an exception is triggered.
The shadow stack is managed using a series of intrinsics that are introduced in this patch as well as the new register (SSP).
The intrinsics are mapped to new instruction set that implements CET mechanism.

The patch also includes initial infrastructure support for IBT.

For more information, please see the following:
https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf

Differential Revision: https://reviews.llvm.org/D40223

Change-Id: I4daa1f27e88176be79a4ac3b4cd26a459e88fed4
llvm-svn: 318996
22 files changed:
llvm/include/llvm/IR/IntrinsicsX86.td
llvm/lib/Support/Host.cpp
llvm/lib/Target/X86/X86.td
llvm/lib/Target/X86/X86InstrCompiler.td
llvm/lib/Target/X86/X86InstrControl.td
llvm/lib/Target/X86/X86InstrInfo.td
llvm/lib/Target/X86/X86InstrSystem.td
llvm/lib/Target/X86/X86RegisterInfo.cpp
llvm/lib/Target/X86/X86RegisterInfo.td
llvm/lib/Target/X86/X86Subtarget.cpp
llvm/lib/Target/X86/X86Subtarget.h
llvm/test/CodeGen/MIR/X86/frame-info-save-restore-points.mir
llvm/test/CodeGen/X86/GlobalISel/irtranslator-callingconv.ll
llvm/test/CodeGen/X86/ipra-reg-usage.ll
llvm/test/CodeGen/X86/movtopush.mir
llvm/test/CodeGen/X86/tail-call-conditional.mir
llvm/test/CodeGen/X86/x32-cet-intrinsics.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/x64-cet-intrinsics.ll [new file with mode: 0644]
llvm/test/DebugInfo/MIR/X86/live-debug-vars-unused-arg-debugonly.mir
llvm/test/DebugInfo/MIR/X86/live-debug-vars-unused-arg.mir
llvm/test/DebugInfo/X86/live-debug-vars-dse.mir
llvm/test/MC/X86/cet-encoding.s [new file with mode: 0644]