[PATCH] 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..

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 11:51:16 PST 2018


sanjoy added inline comments.


================
Comment at: llvm/lib/CodeGen/IndirectBrExpandPass.cpp:114
+      if (BBIndex == -1) {
+        BBIndex = BBs.size();
+        BBToIndex.insert({&BB, BBIndex});
----------------
`BBIndex` needs to start from `1` I think since "no label is equal to the null pointer".


================
Comment at: llvm/lib/CodeGen/IndirectBrExpandPass.cpp:134
+  // Now rewrite each indirectbr to cast its loaded pointer to an integer and
+  // switch on it using the integer map from above.
+  for (auto *IBr : IndirectBrs) {
----------------
Do we care about inline assembly here?  The langref says "Finally, some targets may provide defined semantics when using the value as the operand to an inline assembly, but that is target specific."


https://reviews.llvm.org/D41723





More information about the llvm-commits mailing list