[PATCH] D40482: [X86] Instrument Control Flow For Indirect Branch Tracking

Oren Ben Simhon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 06:16:12 PST 2017


oren_ben_simhon marked an inline comment as done.
oren_ben_simhon added inline comments.


================
Comment at: include/llvm/Target/TargetOptions.h:221
+    /// mechanisms. For example: in X86 - Indirect Branch Tracking.
+    unsigned InstrumentControlFlow : 1;
+
----------------
pcc wrote:
> This doesn't seem like it needs to be a TargetOption. Can you test for the function attribute directly in your pass?
Sure, I will add a check in the pass for the function attribute. 
Still, I would like the user to be able to give the llc the command option "instrument-control-flow" so that it will be enabled even if the attribute is not set in the function.
Is there a better way to do that than TargetOption?


================
Comment at: lib/Target/TargetMachine.cpp:76
   RESET_OPTION(NoTrappingFPMath, "no-trapping-math");
+  RESET_OPTION(InstrumentControlFlow, "instrument-control-flow");
 
----------------
pcc wrote:
> This name seems very generic and doesn't really describe what the attribute does. How about something like `cet-compatible`?
I wouldn't like this attribute to be target independent.  cet-compatible refers to Intel specific way to protect against control flow attacks. Does "cf-protection" make more sense?


Repository:
  rL LLVM

https://reviews.llvm.org/D40482





More information about the llvm-commits mailing list