[PATCH] D88194: [X86] CET endbr enhance

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 02:02:01 PDT 2020


xiangzhangllvm marked 2 inline comments as done.
xiangzhangllvm added a comment.

@spatel  thank you very much for your review! and very sorry for the later update!
CET stands for Intel Control-flow Enforcement Technology, which was designed by H.J. and has already implemented in llvm and gcc. Now it can be googled out.
CET adds an Indirect Branch Tracking capability (by inserting Endbr instruction at the destination of the indirect branch) to provide software the ability to restrict COP/JOP attacks.



================
Comment at: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1386-1387
+    case X86::MOV32ri: // *32ri
+      Idx = 0;
+      LLVM_FALLTHROUGH;
+    case X86::ADC32ri:
----------------
spatel wrote:
> This code structure with fallthrough is difficult to follow. Create a separate static helper function that just returns the constant operand index for a given opcode?
I really thought using a function and refined here before commit it to phabricator, try to simplify the code I used the LLVM_FALLTHROUGH.
Here not just need 'return' constant operand index, please refer line 1412-1414.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88194/new/

https://reviews.llvm.org/D88194



More information about the llvm-commits mailing list