[clang] [llvm] [ARM][KCFI] Add backend support for Kernel Control-Flow Integrity (PR #163698)

Sami Tolvanen via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 16 10:15:34 PDT 2025


================
@@ -12007,6 +12011,49 @@ static void genTPLoopBody(MachineBasicBlock *TpLoopBody,
       .add(predOps(ARMCC::AL));
 }
 
+bool ARMTargetLowering::supportKCFIBundles() const {
+  // KCFI is only supported in ARM mode, not Thumb mode
+  return !Subtarget->isThumb();
----------------
samitolvanen wrote:

I believe it would require KCFI_CHECK lowering for Thumb, and you'll need make sure you clear the LSB from the function address when calculating the hash location, because ARM uses that to select between ARM/Thumb mode for the callee.

https://github.com/llvm/llvm-project/pull/163698


More information about the cfe-commits mailing list