LLVM  10.0.0svn
Macros | Variables
X86RetpolineThunks.cpp File Reference

Pass that injects an MI thunk implementing a "retpoline". More...

#include "X86.h"
#include "X86InstrBuilder.h"
#include "X86Subtarget.h"
#include "llvm/CodeGen/MachineFunction.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 dependency graph for X86RetpolineThunks.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "x86-retpoline-thunks"
 

Variables

static const char ThunkNamePrefix [] = "__llvm_retpoline_"
 
static const char R11ThunkName [] = "__llvm_retpoline_r11"
 
static const char EAXThunkName [] = "__llvm_retpoline_eax"
 
static const char ECXThunkName [] = "__llvm_retpoline_ecx"
 
static const char EDXThunkName [] = "__llvm_retpoline_edx"
 
static const char EDIThunkName [] = "__llvm_retpoline_edi"
 

Detailed Description

Pass that injects an MI thunk implementing a "retpoline".

This is a RET-implemented trampoline 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.

TODO(chandlerc): All of this code could use better comments and documentation.

Definition in file X86RetpolineThunks.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "x86-retpoline-thunks"

Definition at line 38 of file X86RetpolineThunks.cpp.

Variable Documentation

◆ EAXThunkName

const char EAXThunkName[] = "__llvm_retpoline_eax"
static

Definition at line 42 of file X86RetpolineThunks.cpp.

Referenced by llvm::createX86RetpolineThunksPass().

◆ ECXThunkName

const char ECXThunkName[] = "__llvm_retpoline_ecx"
static

Definition at line 43 of file X86RetpolineThunks.cpp.

Referenced by llvm::createX86RetpolineThunksPass().

◆ EDIThunkName

const char EDIThunkName[] = "__llvm_retpoline_edi"
static

Definition at line 45 of file X86RetpolineThunks.cpp.

Referenced by llvm::createX86RetpolineThunksPass().

◆ EDXThunkName

const char EDXThunkName[] = "__llvm_retpoline_edx"
static

Definition at line 44 of file X86RetpolineThunks.cpp.

Referenced by llvm::createX86RetpolineThunksPass().

◆ R11ThunkName

const char R11ThunkName[] = "__llvm_retpoline_r11"
static

Definition at line 41 of file X86RetpolineThunks.cpp.

◆ ThunkNamePrefix

const char ThunkNamePrefix[] = "__llvm_retpoline_"
static

Definition at line 40 of file X86RetpolineThunks.cpp.