[PATCH] D132386: [AArch64][PAC] Lower auth/resign into checked sequence.

Ahmed Bougacha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 09:02:37 PDT 2022


ab created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a reviewer: apazos.
Herald added a project: All.
ab requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

A lot of this is boilerplate isel; the trapping/checking lowering is the interesting bit.  As a platform decision, we emit the trapping sequence by default, but this is obviously something that can be changed for other platforms (as well as based on later hardware features, most interestingly FPAC).

This also uses x16/x17 as "safe registers" purely because of another platform decision: on Darwin we have additional hardening in the kernel for these registers.  We use those because 1) they're already used for interesting control flow in linker stubs, and 2) these auth/resign sequences don't have calls, so they're not clobbered by said linker stubs.

The expansion is done as late as possible (in AsmPrinter), to avoid any risks of late backend passes breaking the sequence.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132386

Files:
  llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
  llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
  llvm/lib/Target/AArch64/AArch64InstrInfo.td
  llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.cpp
  llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.h
  llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
  llvm/test/CodeGen/AArch64/ptrauth-intrinsic-auth-resign-with-blend.ll
  llvm/test/CodeGen/AArch64/ptrauth-intrinsic-auth-resign.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132386.454528.patch
Type: text/x-patch
Size: 55161 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220822/2a9132c5/attachment-0001.bin>


More information about the llvm-commits mailing list