[PATCH] D101920: [AArch64][v8.3A] Avoid inserting implicit landing pads (PACI*SP)

Pablo Barrio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 02:57:51 PST 2023


pbarrio added a comment.

You are right, yes, the implicit landing pad in PACIxSP is configurable through SCTRL_EL1.BT0. It can behave either as BTI c or BTI jc. Since the value of a sysreg is not known at compile time, I took the safe approach here and assumed that PACIxSP could allow all kinds of jumps and therefore they would be unsafe: better have an explicit BTI c than an implicit BTI jc.

We could take the efficient approach and go back to emitting PACIxSP. It may not be a problem in practice if we are reasonably sure that SCTRL_EL1.BT0 will be 1 in most cases. Worst case, we could allow changing the default behaviour with a CLI flag (e.g. adding another value for -mbranch-protection), or with the triple's ABI field if the decision will be taken by the platform ABI (i.e. --target=*-linux)?

I don't have a strong opinion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101920



More information about the llvm-commits mailing list