Yury Khrustalev <yury.khrusta...@arm.com> writes: > This patch series adds support for the Guarded Control Stack extension [1]. > > GCS marking for binaries is specified in [2]. > > Regression tested on AArch64 and no regressions have been found. > > Is this OK for trunk? > > Sources and branches: > - binutils-gdb: sourceware.org/git/binutils-gdb.git users/ARM/gcs > - gcc: this patch series, or > gcc.gnu.org/git/gcc.git vendors/ARM/gcs-v3 > see https://gcc.gnu.org/gitwrite.html#vendor for setup details > - glibc: sourceware.org/git/glibc.git arm/gcs-v2 > - kernel: git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git > for-next/gcs > > Cross-building the toolchain for target aarch64-none-linux-gnu: > - build and install binutils-gdb > - build and install GCC stage 1 > - install kernel headers > - install glibc headers > - build and install GCC stage 2 configuring with > --enable-standard-branch-protection > - build and install glibc > - build and install GCC stage 3 along with target libraries configuring with > --enable-standard-branch-protection > > FVP model provided by the Shrinkwrap tool [3] can be used for testing. > > Run tests with environment var > > GLIBC_TUNABLES=glibc.cpu.aarch64_gcs=1:glibc.cpu.aarch64_gcs_policy=2 > > See details about Glibc tunables in corresponding Glibc patch [4]. > > Corresponding binutils patch [5]. > > [1] https://developer.arm.com/documentation/ddi0487/ka/ (chapter D11) > [2] https://github.com/ARM-software/abi-aa/blob/main/sysvabi64/sysvabi64.rst > [3] https://git.gitlab.arm.com/tooling/shrinkwrap.git > [4] > https://inbox.sourceware.org/libc-alpha/20241023083920.466015-1-yury.khrusta...@arm.com/ > [5] > https://inbox.sourceware.org/binutils/20241014101743.3222246-1-yury.khrusta...@arm.com/
Thanks for this. I've replied to some individual patches, but the ones I didn't reply to look ok as-is. Richard > > --- > > Matthieu Longo (1): > aarch64: Fix tests incompatible with GCS > > Richard Ball (1): > aarch64: Add tests and docs for indirect_return attribute > > Szabolcs Nagy (19): > aarch64: Add -mbranch-protection=gcs option > aarch64: Add branch-protection target pragma tests > aarch64: Add support for chkfeat insn > aarch64: Add __builtin_aarch64_chkfeat > aarch64: Add __builtin_aarch64_chkfeat tests > aarch64: Add GCS instructions > aarch64: Add GCS builtins > aarch64: Add __builtin_aarch64_gcs* tests > aarch64: Add GCS support for nonlocal stack save > aarch64: Add non-local goto and jump tests for GCS > aarch64: Add ACLE feature macros for GCS > aarch64: Add test for GCS ACLE defs > aarch64: Add target pragma tests for gcs > aarch64: Add GCS support to the unwinder > aarch64: Emit GNU property NOTE for GCS > aarch64: libgcc: add GCS marking to asm > aarch64: libatomic: add GCS marking to asm > aarch64: libitm: Add GCS support > aarch64: Introduce indirect_return attribute > > Yury Khrustalev (1): > aarch64: Fix nonlocal goto tests incompatible with GCS > > gcc/config/aarch64/aarch64-builtins.cc | 88 ++++++++++++ > gcc/config/aarch64/aarch64-c.cc | 3 + > gcc/config/aarch64/aarch64-protos.h | 2 + > gcc/config/aarch64/aarch64.cc | 40 ++++++ > gcc/config/aarch64/aarch64.h | 7 + > gcc/config/aarch64/aarch64.md | 126 ++++++++++++++++++ > gcc/config/aarch64/aarch64.opt | 3 + > gcc/config/arm/aarch-bti-insert.cc | 36 ++++- > gcc/configure | 2 +- > gcc/configure.ac | 6 +- > gcc/doc/extend.texi | 5 + > gcc/doc/invoke.texi | 5 +- > gcc/testsuite/g++.target/aarch64/pr94515-1.C | 6 +- > .../return_address_sign_ab_exception.C | 19 ++- > gcc/testsuite/gcc.target/aarch64/chkfeat-1.c | 75 +++++++++++ > gcc/testsuite/gcc.target/aarch64/chkfeat-2.c | 15 +++ > gcc/testsuite/gcc.target/aarch64/eh_return.c | 13 ++ > .../gcc.target/aarch64/gcs-nonlocal-1.c | 25 ++++ > .../gcc.target/aarch64/gcs-nonlocal-2.c | 21 +++ > .../gcc.target/aarch64/gcs-nonlocal-3.c | 33 +++++ > gcc/testsuite/gcc.target/aarch64/gcspopm-1.c | 69 ++++++++++ > gcc/testsuite/gcc.target/aarch64/gcspr-1.c | 31 +++++ > gcc/testsuite/gcc.target/aarch64/gcsss-1.c | 49 +++++++ > .../gcc.target/aarch64/indirect_return.c | 25 ++++ > gcc/testsuite/gcc.target/aarch64/pr104689.c | 3 +- > .../gcc.target/aarch64/pragma_cpp_predefs_1.c | 30 +++++ > .../gcc.target/aarch64/pragma_cpp_predefs_4.c | 85 ++++++++++++ > .../gcc.target/aarch64/sme/nonlocal_goto_4.c | 2 +- > .../gcc.target/aarch64/sme/nonlocal_goto_5.c | 2 +- > .../gcc.target/aarch64/sme/nonlocal_goto_6.c | 2 +- > libatomic/config/linux/aarch64/atomic_16.S | 11 +- > libgcc/config/aarch64/aarch64-asm.h | 16 ++- > libgcc/config/aarch64/aarch64-unwind.h | 59 +++++++- > libitm/config/aarch64/sjlj.S | 60 ++++++++- > libitm/config/aarch64/target.h | 1 + > 35 files changed, 944 insertions(+), 31 deletions(-) > create mode 100644 gcc/testsuite/gcc.target/aarch64/chkfeat-1.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/chkfeat-2.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/gcs-nonlocal-1.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/gcs-nonlocal-2.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/gcs-nonlocal-3.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/gcspopm-1.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/gcspr-1.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/gcsss-1.c > create mode 100644 gcc/testsuite/gcc.target/aarch64/indirect_return.c