⚙ D41723 Introduce the "retpoline" x86 mitigation technique for variant #2 of the speculative execution vulnerabilities disclosed today, specifically identified by CVE-2017-5715, "Branch Target Injection", and is one of the two halves to Spectre..

5 min read Original article ↗

This is an archive of the discontinued LLVM Phabricator instance.

  • -

    ELF/

  • -

    Arch/

  • -

    X86.cpp

  • -

    X86_64.cpp

  • -

    Config.h

  • -

    Driver.cpp

  • -

    test/ELF/

  • -

    ELF/

  • -

    i386-retpoline-nopic.s

  • -

    i386-retpoline-pic.s

  • -

    x86-64-retpoline-znow.s

  • -

    x86-64-retpoline.s

Authored by chandlerc on Jan 4 2018, 1:14 AM.

Reviewers
echristo
rnk
ruiu
craig.topper
DavidKreitzer
ab
MatzeB
Commits
rG64aeffbb5c3a: Merging r323155: --------------------------------------------------------------…
rGf21e34b3a147: Merging r323155: --------------------------------------------------------------…
rG4321822f1df5: Merging r323155: --------------------------------------------------------------…
rGff3a8f17df56: Merging r323155 in LLD, with modifications to handle int3 fill
rGf94a984645fe: Merging r323155: --------------------------------------------------------------…
rG507d5d8ef987: Merging r323155: --------------------------------------------------------------…
rGc58f2166ab39: Introduce the "retpoline" x86 mitigation technique for variant #2 of the…
rL324069: Merging r323155:
rL324068: Merging r323155:
rL324067: Merging r323155:
rL324025: Merging r323155 in LLD, with modifications to handle int3 fill
rL324012: Merging r323155:
rL324007: Merging r323155:
rL323155: Introduce the "retpoline" x86 mitigation technique for variant #2 of the…
rC323155: Introduce the "retpoline" x86 mitigation technique for variant #2 of the…
rLLD323155: Introduce the "retpoline" x86 mitigation technique for variant #2 of the…
Repository
rLLD LLVM Linker

Event Timeline

chandlerc created this revision.

Harbormaster completed remote builds in B13510: Diff 128605.

Herald added subscribers: hiraditya, mehdi_amini, mgorny and 3 others.

This revision is now accepted and ready to land.

smeenai added a subscriber: smeenai.

smeenai added subscribers: espindola, grimar.

xiangzhai added a subscriber: xiangzhai.

JDevlieghere added a subscriber: JDevlieghere.

emaste added a subscriber: dim.

dexonsmith added a subscriber: dexonsmith.

lld/ELF/Arch/X86.cpp
491 ↗(On Diff #128605)

majnemer added a subscriber: majnemer.

majnemer added inline comments.

clang/lib/Basic/Targets/X86.cpp
1306 ↗(On Diff #128605)
llvm/lib/CodeGen/IndirectBrExpandPass.cpp
97–99 ↗(On Diff #128605)
161 ↗(On Diff #128605)
llvm/lib/Target/X86/X86ISelLowering.cpp
27082–27083 ↗(On Diff #128605)

rnk added inline comments.

lld/ELF/Arch/X86.cpp
491 ↗(On Diff #128605)

clang/lib/Basic/Targets/X86.cpp
1306 ↗(On Diff #128605)
llvm/lib/CodeGen/IndirectBrExpandPass.cpp
97–99 ↗(On Diff #128605)
161 ↗(On Diff #128605)
llvm/lib/Target/X86/X86ISelLowering.cpp
27082–27083 ↗(On Diff #128605)

majnemer added inline comments.

llvm/lib/CodeGen/IndirectBrExpandPass.cpp
161 ↗(On Diff #128605)

AndreiGrischenko added a subscriber: AndreiGrischenko.

sanjoy added inline comments.

llvm/lib/CodeGen/IndirectBrExpandPass.cpp
114 ↗(On Diff #128629)
134 ↗(On Diff #128629)

llvm/lib/CodeGen/IndirectBrExpandPass.cpp
113 ↗(On Diff #128629)

ruiu added inline comments.

lld/ELF/Arch/X86.cpp
491 ↗(On Diff #128605)
lld/ELF/Arch/X86_64.cpp
517–525 ↗(On Diff #128629)

kristof.beyls added a subscriber: kristof.beyls.

AndreiGrischenko added inline comments.

llvm/lib/Target/X86/X86InstrCompiler.td
1160 ↗(On Diff #128629)
llvm/lib/Target/X86/X86RetpolineThunks.cpp
121 ↗(On Diff #128629)

lld/ELF/Arch/X86.cpp
491 ↗(On Diff #128605)
lld/ELF/Arch/X86_64.cpp
517–525 ↗(On Diff #128629)
llvm/lib/CodeGen/IndirectBrExpandPass.cpp
113 ↗(On Diff #128629)
134 ↗(On Diff #128629)
llvm/lib/Target/X86/X86InstrCompiler.td
1160 ↗(On Diff #128629)
llvm/lib/Target/X86/X86RetpolineThunks.cpp
121 ↗(On Diff #128629)

sanjoy added inline comments.

llvm/lib/CodeGen/IndirectBrExpandPass.cpp
134 ↗(On Diff #128629)

rnk added inline comments.

llvm/lib/Target/X86/X86InstrCompiler.td
1160 ↗(On Diff #128629)

efriedma added inline comments.

llvm/lib/CodeGen/IndirectBrExpandPass.cpp
113 ↗(On Diff #128629)

dexonsmith added inline comments.

llvm/lib/CodeGen/IndirectBrExpandPass.cpp
113 ↗(On Diff #128629)

davidxl added a subscriber: davidxl.

davidxl added inline comments.

clang/lib/Basic/Targets/X86.cpp
1306 ↗(On Diff #128605)

Harbormaster completed remote builds in B13521: Diff 128675.

Harbormaster completed remote builds in B13523: Diff 128678.

chandlerc added inline comments.

llvm/lib/CodeGen/IndirectBrExpandPass.cpp
134 ↗(On Diff #128629)

chandlerc added inline comments.

llvm/lib/CodeGen/IndirectBrExpandPass.cpp
113 ↗(On Diff #128629)
llvm/lib/Target/X86/X86InstrCompiler.td
1160 ↗(On Diff #128629)

llvm/lib/CodeGen/IndirectBrExpandPass.cpp
56 ↗(On Diff #128629)
llvm/lib/Target/X86/X86ISelLowering.cpp
27120 ↗(On Diff #128629)
llvm/lib/Target/X86/X86RetpolineThunks.cpp
119 ↗(On Diff #128629)
171 ↗(On Diff #128629)
183 ↗(On Diff #128629)
llvm/lib/Target/X86/X86Subtarget.h
344 ↗(On Diff #128629)

MaskRay added a subscriber: MaskRay.

Harbormaster completed remote builds in B13531: Diff 128698.

llvm/lib/Target/X86/X86ISelLowering.cpp
27120 ↗(On Diff #128629)
llvm/lib/Target/X86/X86RetpolineThunks.cpp
183 ↗(On Diff #128629)

arichardson added a subscriber: arichardson.

tschuett added a subscriber: tschuett.

eax added a subscriber: eax.

Harbormaster completed remote builds in B13535: Diff 128715.

Harbormaster completed remote builds in B13537: Diff 128721.

ddibyend added a subscriber: ddibyend.

qcolombet added a subscriber: qcolombet.

Harbormaster completed remote builds in B13566: Diff 128834.

jbhateja added a subscriber: jbhateja.

MatzeB added a subscriber: MatzeB.

MatzeB added inline comments.

llvm/lib/Target/X86/X86RetpolineThunks.cpp
82–83 ↗(On Diff #128834)

n.bozhenov added a subscriber: n.bozhenov.

lattera added a subscriber: lattera.

FlameTop added a subscriber: FlameTop.

fsbruva added a subscriber: fsbruva.

nullius added a subscriber: nullius.

Harbormaster completed remote builds in B13835: Diff 129849.

llvm/lib/Target/X86/X86RetpolineThunks.cpp
82–83 ↗(On Diff #128834)

mnagaraj added a subscriber: mnagaraj.

anujm1 added a subscriber: anujm1.

sylvestre.ledru added a subscriber: sylvestre.ledru.

llvm/include/llvm/CodeGen/TargetPassConfig.h
412–413 ↗(On Diff #130532)
414 ↗(On Diff #130532)
llvm/lib/Target/X86/X86RetpolineThunks.cpp
83–84 ↗(On Diff #130532)

llvm/include/llvm/CodeGen/TargetPassConfig.h
414 ↗(On Diff #130532)

This revision was automatically updated to reflect the committed changes.

chandlerc marked an inline comment as done.

GGanesh added a subscriber: GGanesh.

GGanesh removed a subscriber: GGanesh.

GGanesh added a subscriber: GGanesh.

PathSize

ELF/

Arch/

144 lines
127 lines
1 line
1 line

test/

ELF/

81 lines
62 lines
53 lines
66 lines
DiffIDBaseDescriptionCreatedLintUnit
BaseBase
Diff 11286057e1520eJan 4 2018, 1:14 AM

Diff 21286297e1520eFix suggested in code review and a couple of indentation fixes via clang-formatJan 4 2018, 10:17 AM

Diff 31286757e1520eFix several bugs caught in code review, as well as implementing suggestions.Jan 4 2018, 4:22 PM

Diff 41286787e1520eAdd another minor suggestion that I forgot previously.Jan 4 2018, 4:30 PM

Diff 51286987e1520eAdd support for externally provided thunks. This is an independent feature;Jan 4 2018, 6:06 PM

Diff 61287007e1520eAdd the new test file for external thunks.Jan 4 2018, 6:12 PM

Diff 71287159bd7570Rebase and fold in the latest batch of changes from Rui based on the reviewJan 5 2018, 1:51 AM

Diff 81287219bd7570Add explicit checks for various lowerings that would need direct retpolineJan 5 2018, 2:45 AM

Diff 91288349bd7570Teach the thunk emission to put them in comdats and enhance tests to verifyJan 5 2018, 5:45 PM

Diff 101298492d89446Re-implement the indirectbr removal pass based on Rafael's suggestion. It nowJan 15 2018, 5:50 AM

Diff 111298502d89446Couple of other minor fixes.Jan 15 2018, 5:55 AM

Diff 121305323346fe6Add the `lfence` instruction to all of the speculation capture loops, bothJan 18 2018, 6:14 PM

Diff 13130959323154rLLD323155Jan 22 2018, 2:05 PM