llvm-project/llvm/lib
Zola Bridges bf95cf4a68 [x86][seses] Introduce SESES pass for LVI
This is an implementation of Speculative Execution Side Effect
Suppression which is intended as a last resort mitigation against Load
Value Injection, LVI, a newly disclosed speculative execution side
channel vulnerability.

One pager:
https://software.intel.com/security-software-guidance/software-guidance/load-value-injection

Deep dive:
https://software.intel.com/security-software-guidance/insights/deep-dive-load-value-injection

The mitigation consists of a compiler pass that inserts an LFENCE before
each memory read instruction, memory write instruction, and the first
branch instruction in a group of terminators at the end of a basic
block. The goal is to prevent speculative execution, potentially based
on misspeculated conditions and/or containing secret data, from leaking
that data via side channels embedded in such instructions.

This is something of a last-resort mitigation: it is expected to have
extreme performance implications and it may not be a complete mitigation
due to trying to enumerate side channels.

In addition to the full version of the mitigation, this patch
implements three flags to turn off part of the mitigation. These flags
are disabled by default. The flags are not intended to result in a
secure variant of the mitigation. The flags are intended to be used by
users who would like to experiment with improving the performance of
the mitigation. I ran benchmarks with each of these flags enabled in
order to find if there was any room for further optimization of LFENCE
placement with respect to LVI.

Performance Testing Results

When applying this mitigation to BoringSSL, we see the following
results. These are a summary/aggregation of the performance changes when
this mitigation is applied versus when no mitigation is applied.

Fully Mitigated vs Baseline
Geometric mean
0.071 (Note: This can be read as the ops/s of the mitigated
program was 7.1% of the ops/s of the unmitigated program.)
Minimum
0.041
Quartile 1
0.060
Median
0.063
Quartile 3
0.077
Maximum
0.230

Reviewed By: george.burgess.iv

Differential Revision: https://reviews.llvm.org/D75939
2020-05-11 09:34:37 -07:00
..
Analysis [llvm][NFC] Move inlining decision-related APIs in InliningAdvisor. 2020-05-11 09:00:59 -07:00
AsmParser LLParser.h - remove unused ValueHandle.h include. NFC. 2020-05-09 15:08:48 +01:00
BinaryFormat XCOFF.h - replace StringRef.h include with forward declaration. NFC. 2020-04-23 13:52:48 +01:00
Bitcode [BitcodeReader] Simplify raw attribute handling (NFC) 2020-04-30 18:47:14 +02:00
Bitstream [Bitcode] reserve in front of push_back loops. NFCI. 2020-05-01 15:52:53 +02:00
CodeGen Revert "[DAGCombine] Remove the getNegatibleCost to avoid the out of sync with getNegatedExpression" 2020-05-11 16:44:01 +02:00
DWARFLinker Reland D79501 "[DebugInfo] Fix handling DW_OP_call_ref in DWARF64 units." 2020-05-08 09:35:54 -07:00
DebugInfo [DebugInfo] Dump raw data in a case of decoding error of an expression. 2020-05-09 10:04:22 +07:00
Demangle
ExecutionEngine [ORC] Share ownership of JITDylibs between ExecutionSession and 2020-05-10 16:37:17 -07:00
Extensions Update compiler extension integration into the build system 2020-04-24 09:40:14 +02:00
Frontend [cmake] LLVMFrontendOpenMP - fix include/llvm/Frontend/OpenMP header path 2020-04-18 12:31:39 +01:00
FuzzMutate Remove CompositeType class. 2020-03-18 13:53:17 -07:00
Fuzzer
IR [NFC][DwarfDebug] Add test for variables with a single location which 2020-05-11 11:49:11 +02:00
IRReader
LTO [LTO] Suppress emission of empty combined module by default 2020-05-04 18:31:09 -07:00
LineEditor
Linker [SVE] Add new VectorType subclasses 2020-04-22 08:59:01 -07:00
MC [NFC] Clean up in MCObjectStreamer and X86AsmBackend 2020-05-09 12:50:44 +08:00
MCA [MCA][InstrBuilder] Correctly mark reserved resources in initializeUsedResources. 2020-05-10 19:25:54 +01:00
Object [Object] Remove unused variable after D79560. NFC. 2020-05-11 13:03:53 +08:00
ObjectYAML [PDB] Remove unique_ptr wrapper around C13 line table subsections 2020-05-02 16:35:07 -07:00
Option
Passes [NFC][DwarfDebug] Add test for variables with a single location which 2020-05-11 11:49:11 +02:00
ProfileData [gcov] Implement --stdout -t 2020-05-10 21:02:38 -07:00
Remarks RemarkStringTable.h - reduce StringRef/Remark includes to forward declarations. NFC 2020-05-08 12:30:49 +01:00
Support NativeFormatting.h - reduce raw_ostream.h include to forward declaration. NFC. 2020-05-09 13:32:14 +01:00
TableGen [TableGen] Simplify with TGParser::consume() 2020-04-26 15:26:49 -07:00
Target [x86][seses] Introduce SESES pass for LVI 2020-05-11 09:34:37 -07:00
Testing
TextAPI [cmake] Add headers in TextAPI/Elf and TextAPI/MachO subdirectories 2020-04-24 18:42:44 +01:00
ToolDrivers [COFF] Use Expected in COFFObjectFile creation 2020-05-08 14:22:28 -07:00
Transforms [llvm][NFC] Move inlining decision-related APIs in InliningAdvisor. 2020-05-11 09:00:59 -07:00
WindowsManifest Try to fix WindowsManifest CMake logic on Windows 2020-02-28 17:24:03 -08:00
XRay [Object] Change ObjectFile::getSymbolValue() return type to Expected<uint64_t> 2020-05-02 14:04:44 +08:00
CMakeLists.txt Update compiler extension integration into the build system 2020-04-24 09:40:14 +02:00
LLVMBuild.txt Update compiler extension integration into the build system 2020-04-24 09:40:14 +02:00