[PATCH] D70635: Reland [AArch64][MachineOutliner] Return address signing for outlined functions

David Tellenbach via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 23 09:53:57 PST 2019


tellenbach created this revision.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls.
Herald added a project: LLVM.

Reland after fixing a bug that allowed outlining of SP modifiying instructions
that invalidated return address signing.

During AArch64 frame lowering instructions to enable return address
signing are inserted into functions if needed. Functions generated during
machine outlining don't run through target frame lowering and hence are
missing such instructions.

This patch introduces the following changes:

1. If not all functions that potentially participate in function outlining agree on their return address signing scope and their return address signing key, outlining is disabled for these functions.
2. If not all functions that potentially participate in function outlining agree on their support for v8.3A features, outlining is disabled for these functions.
3. If an outlining candidate would outline instructions that modify sp in a way that invalidates return address signing, outlining is disabled for that particular candidate.
4. If all candidate functions agree on the signing scope, signing key and their support for v8.3 features, the outlined function behaves as if it had the same scope and key attributes and as if it would provide the same v8.3A support as the original functions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70635

Files:
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-cfi.ll
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-diff-scope-same-key.ll
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-non-leaf.ll
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-regsave.mir
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-diff-key.ll
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-same-key-a.ll
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-same-key-b.ll
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.mir
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-subtarget.ll
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-thunk.ll
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-v8-3.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70635.230768.patch
Type: text/x-patch
Size: 54335 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191123/50eae32e/attachment.bin>


More information about the llvm-commits mailing list