1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/lib/Target/Mips
Simon Dardis 8181753289 [mips] Spectre variant two mitigation for MIPSR2
This patch provides mitigation for CVE-2017-5715, Spectre variant two,
which affects the P5600 and P6600. It implements the LLVM part of
-mindirect-jump=hazard. It is _not_ enabled by default for the P5600.

The migitation strategy suggested by MIPS for these processors is to use
hazard barrier instructions. 'jalr.hb' and 'jr.hb' are hazard
barrier variants of the 'jalr' and 'jr' instructions respectively.

These instructions impede the execution of instruction stream until
architecturally defined hazards (changes to the instruction stream,
privileged registers which may affect execution) are cleared. These
instructions in MIPS' designs are not speculated past.

These instructions are used with the attribute +use-indirect-jump-hazard
when branching indirectly and for indirect function calls.

These instructions are defined by the MIPS32R2 ISA, so this mitigation
method is not compatible with processors which implement an earlier
revision of the MIPS ISA.

Performance benchmarking of this option with -fpic and lld using
-z hazardplt shows a difference of overall 10%~ time increase
for the LLVM testsuite. Certain benchmarks such as methcall show a
substantially larger increase in time due to their nature.

Reviewers: atanasyan, zoran.jovanovic

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

llvm-svn: 325653
2018-02-21 00:06:53 +00:00
..
AsmParser [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
Disassembler
InstPrinter
MCTargetDesc
TargetInfo
CMakeLists.txt
LLVMBuild.txt
MicroMips32r6InstrFormats.td
MicroMips32r6InstrInfo.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MicroMipsDSPInstrFormats.td
MicroMipsDSPInstrInfo.td
MicroMipsInstrFormats.td [mips] Define certain instructions in microMIPS32r3 2018-02-08 09:25:17 +00:00
MicroMipsInstrFPU.td [mips] Define certain instructions in microMIPS32r3 2018-02-08 09:25:17 +00:00
MicroMipsInstrInfo.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MicroMipsSizeReduction.cpp
Mips16FrameLowering.cpp
Mips16FrameLowering.h
Mips16HardFloat.cpp
Mips16HardFloatInfo.cpp
Mips16HardFloatInfo.h
Mips16InstrFormats.td
Mips16InstrInfo.cpp
Mips16InstrInfo.h
Mips16InstrInfo.td [NFC] fix trivial typos in comments and documents 2018-01-26 08:15:29 +00:00
Mips16ISelDAGToDAG.cpp
Mips16ISelDAGToDAG.h
Mips16ISelLowering.cpp
Mips16ISelLowering.h
Mips16RegisterInfo.cpp
Mips16RegisterInfo.h
Mips32r6InstrFormats.td
Mips32r6InstrInfo.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
Mips64InstrInfo.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
Mips64r6InstrInfo.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
Mips.h
Mips.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsAnalyzeImmediate.cpp
MipsAnalyzeImmediate.h
MipsAsmPrinter.cpp [mips] Support 'y' operand code to print exact log2 of the operand 2018-02-07 12:36:39 +00:00
MipsAsmPrinter.h
MipsCallingConv.td
MipsCCState.cpp
MipsCCState.h
MipsCondMov.td
MipsConstantIslandPass.cpp
MipsDelaySlotFiller.cpp [NFC] fix trivial typos in comments 2018-01-22 05:54:46 +00:00
MipsDSPInstrFormats.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsDSPInstrInfo.td
MipsEVAInstrFormats.td
MipsEVAInstrInfo.td [mips] Include EVA instructions in Std2MicroMips mapping tables 2018-02-01 12:53:26 +00:00
MipsFastISel.cpp
MipsFrameLowering.cpp
MipsFrameLowering.h
MipsHazardSchedule.cpp
MipsInstrFormats.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsInstrFPU.td [mips] Correct the definition of cvt.d.w 2018-02-20 15:55:17 +00:00
MipsInstrInfo.cpp [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsInstrInfo.h
MipsInstrInfo.td [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsISelDAGToDAG.cpp [SelectionDAGISel] Add a debug print before call to Select. Adjust where blank lines are printed during isel process to make things more sensibly grouped. 2018-01-26 19:34:20 +00:00
MipsISelDAGToDAG.h
MipsISelLowering.cpp [MIPS][MSA] Convert vector integer min/max opcodes to use generic implementation 2018-02-17 21:29:45 +00:00
MipsISelLowering.h [MIPS][MSA] Convert vector integer min/max opcodes to use generic implementation 2018-02-17 21:29:45 +00:00
MipsLongBranch.cpp [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsMachineFunction.cpp
MipsMachineFunction.h
MipsMCInstLower.cpp
MipsMCInstLower.h
MipsModuleISelDAGToDAG.cpp
MipsMSAInstrFormats.td
MipsMSAInstrInfo.td [MIPS][MSA] Convert vector integer min/max opcodes to use generic implementation 2018-02-17 21:29:45 +00:00
MipsMTInstrFormats.td
MipsMTInstrInfo.td
MipsOptimizePICCall.cpp
MipsOptionRecord.h
MipsOs16.cpp
MipsRegisterInfo.cpp Revert accidental changes that snuck in r324584 2018-02-08 09:31:48 +00:00
MipsRegisterInfo.h
MipsRegisterInfo.td
MipsSchedule.td
MipsScheduleGeneric.td
MipsScheduleP5600.td
MipsSEFrameLowering.cpp
MipsSEFrameLowering.h
MipsSEInstrInfo.cpp [mips] Define certain instructions in microMIPS32r3 2018-02-08 09:25:17 +00:00
MipsSEInstrInfo.h [mips] Define certain instructions in microMIPS32r3 2018-02-08 09:25:17 +00:00
MipsSEISelDAGToDAG.cpp [NFC] fix trivial typos in comments 2018-01-22 05:54:46 +00:00
MipsSEISelDAGToDAG.h
MipsSEISelLowering.cpp [MIPS][MSA] Convert vector integer min/max opcodes to use generic implementation 2018-02-17 21:29:45 +00:00
MipsSEISelLowering.h
MipsSERegisterInfo.cpp
MipsSERegisterInfo.h
MipsSubtarget.cpp [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsSubtarget.h [mips] Spectre variant two mitigation for MIPSR2 2018-02-21 00:06:53 +00:00
MipsTargetMachine.cpp
MipsTargetMachine.h
MipsTargetObjectFile.cpp [MIPS] Don't crash on unsized extern types with -mgpopt 2018-01-26 15:56:14 +00:00
MipsTargetObjectFile.h
MipsTargetStreamer.h
MSA.txt
Relocation.txt