LLVM 20.0.0git
|
Pass that injects an MI thunk that is used to lower indirect calls in a way that prevents speculation on some x86 processors and can be used to mitigate security vulnerabilities due to targeted speculative execution and side channels such as CVE-2017-5715. More...
#include "X86.h"
#include "X86InstrBuilder.h"
#include "X86Subtarget.h"
#include "llvm/CodeGen/IndirectThunks.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "x86-retpoline-thunks" |
Variables | |
static const char | RetpolineNamePrefix [] = "__llvm_retpoline_" |
static const char | R11RetpolineName [] = "__llvm_retpoline_r11" |
static const char | EAXRetpolineName [] = "__llvm_retpoline_eax" |
static const char | ECXRetpolineName [] = "__llvm_retpoline_ecx" |
static const char | EDXRetpolineName [] = "__llvm_retpoline_edx" |
static const char | EDIRetpolineName [] = "__llvm_retpoline_edi" |
static const char | LVIThunkNamePrefix [] = "__llvm_lvi_thunk_" |
static const char | R11LVIThunkName [] = "__llvm_lvi_thunk_r11" |
Pass that injects an MI thunk that is used to lower indirect calls in a way that prevents speculation on some x86 processors and can be used to mitigate security vulnerabilities due to targeted speculative execution and side channels such as CVE-2017-5715.
Currently supported thunks include:
Note that the reason that this is implemented as a MachineFunctionPass and not a ModulePass is that ModulePasses at this point in the LLVM X86 pipeline serialize all transformations, which can consume lots of memory.
TODO(chandlerc): All of this code could use better comments and documentation.
Definition in file X86IndirectThunks.cpp.
#define DEBUG_TYPE "x86-retpoline-thunks" |
Definition at line 49 of file X86IndirectThunks.cpp.
Definition at line 53 of file X86IndirectThunks.cpp.
Definition at line 54 of file X86IndirectThunks.cpp.
Definition at line 56 of file X86IndirectThunks.cpp.
Definition at line 55 of file X86IndirectThunks.cpp.
Definition at line 58 of file X86IndirectThunks.cpp.
Definition at line 59 of file X86IndirectThunks.cpp.
Definition at line 52 of file X86IndirectThunks.cpp.
Definition at line 51 of file X86IndirectThunks.cpp.