[all-commits] [llvm/llvm-project] 0fbb17: [ARM] Implement setjmp BTI placement for PACBTI-M

Ties Stuij via All-commits all-commits at lists.llvm.org
Mon Dec 6 03:07:38 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0fbb17458a01a6b388fc67661ffb92969503e977
      https://github.com/llvm/llvm-project/commit/0fbb17458a01a6b388fc67661ffb92969503e977
  Author: Ties Stuij <ties.stuij at arm.com>
  Date:   2021-12-06 (Mon, 06 Dec 2021)

  Changed paths:
    M clang/docs/ClangCommandLineReference.rst
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/ToolChains/Arch/ARM.cpp
    A clang/test/Driver/arm-bti-return-twice.c
    M llvm/lib/Target/ARM/ARM.td
    M llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/lib/Target/ARM/ARMISelLowering.h
    M llvm/lib/Target/ARM/ARMInstrThumb2.td
    M llvm/lib/Target/ARM/ARMSubtarget.h
    A llvm/test/CodeGen/ARM/setjmp-bti-basic.ll
    A llvm/test/CodeGen/ARM/setjmp-bti-outliner.ll

  Log Message:
  -----------
  [ARM] Implement setjmp BTI placement for PACBTI-M

This patch intends to guard indirect branches performed by longjmp
by inserting BTI instructions after calls to setjmp.

Calls with 'returns-twice' are lowered to a new pseudo-instruction
named t2CALL_BTI that is later expanded to a bundle of {tBL,t2BTI}.

This patch is part of a series that adds support for the PACBTI-M extension of
the Armv8.1-M architecture, as detailed here:

https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension

The PACBTI-M specification can be found in the Armv8-M Architecture Reference
Manual:

https://developer.arm.com/documentation/ddi0553/latest

The following people contributed to this patch:

- Alexandros Lamprineas
- Ties Stuij

Reviewed By: labrinea

Differential Revision: https://reviews.llvm.org/D112427




More information about the All-commits mailing list