Geoffrey Keatinggeoffk
Brendan Kehoe -
Richard Kenner kenner
+Yury Khrustalev ykhrustalev
Andi Kleen ak
Matthias Klose doko
On Fri, Nov 29, 2024 at 02:31:34PM +, Kyrylo Tkachov wrote:
>
> > Would you recommend to re-phrase the commit message?
>
> Thanks for explaining. Yes, I think describing the use case a bit more in the
> commit message like you just did would be useful.
> Ok with that change.
> Kyrill
Thanks
Including the "arm_acle.h" header in aarch64-unwind.h requires
stdint.h to be present and it may not be available during the
first stage of cross-compilation of GCC.
When cross-building GCC for the aarch64-none-linux-gnu target
(on any supporting host) using the 3-stage bootstrap build
process whe
Hi Kyrill,
On Fri, Nov 29, 2024 at 02:06:17PM +, Kyrylo Tkachov wrote:
> Hi Yury,
>
> > On 29 Nov 2024, at 13:57, Yury Khrustalev wrote:
> >
> > Inclusion of "arm_acle.h" would requires stdint.h that may
> > not be available during first stage of
Inclusion of "arm_acle.h" would requires stdint.h that may
not be available during first stage of cross-compilation.
libgcc/ChangeLog:
* config/aarch64/aarch64-unwind.h (_CHKFEAT_GCS): Add.
---
Regression tested on aarch64-unknown-linux-gnu and no regressions have been
found.
Is this
Add ACLE macro _CHKFEAT_GCS for AArch64.
Regression tested on aarch64-none-linux-gnu and no regressions have
been found. Is it OK for trunk?
Applies to dbc38dd9e96.
I don't have commit access so I need someone to commit on my behalf.
---
Yury Khrustalev (1):
aarch64: add ACLE
gcc/ChangeLog:
* config/aarch64/arm_acle.h (_CHKFEAT_GCS): New.
libgcc/ChangeLog:
* config/aarch64/aarch64-unwind.h (_Unwind_Frames_Extra): Update.
(_Unwind_Frames_Increment): Update
---
gcc/config/aarch64/arm_acle.h | 3 +++
libgcc/config/aarch64/aarch64-unwind.
On Thu, Nov 14, 2024 at 08:53:48PM +, Sam James wrote:
> r15-5257-g56ded80b96b0f6 didn't regenerate configure correctly.
>
> See https://inbox.sourceware.org/gcc-patches/zzzf69gorvpro...@zen.kayari.org/.
>
> gcc/ChangeLog:
>
> * configure: Regenerate.
> ---
> Pushed as obvious.
Thank
Hi Jonathan,
On Thu, Nov 14, 2024 at 08:39:07PM +, Jonathan Wakely wrote:
> On 14/11/24 12:36 +0000, Yury Khrustalev wrote:
> > From: Szabolcs Nagy
> >
> > ...
> >
> > @@ -28093,7 +28093,7 @@ if test "${enable_standard_branch_protection+se
From: Szabolcs Nagy
gcc/ChangeLog:
* config/aarch64/aarch64.cc (GNU_PROPERTY_AARCH64_FEATURE_1_GCS):
Define.
(aarch64_file_end_indicate_exec_stack): Set GCS property bit.
---
gcc/config/aarch64/aarch64.cc | 5 +
1 file changed, 5 insertions(+)
diff --git a/gcc/confi
From: Szabolcs Nagy
gcc/ChangeLog:
* config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Define
macros for GCS.
---
gcc/config/aarch64/aarch64-c.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc
ind
From: Szabolcs Nagy
libatomic/ChangeLog:
* config/linux/aarch64/atomic_16.S (FEATURE_1_GCS): Define.
(GCS_FLAG): Define if GCS is enabled.
(GNU_PROPERTY): Add GCS_FLAG.
---
libatomic/config/linux/aarch64/atomic_16.S | 11 +--
1 file changed, 9 insertions(+), 2 de
Hi Richard,
I'll reply to this message only to avoid almost identical emails
for each commented on patch.
Thank you for your comments and suggestions!
I've made fixes as per your comments and uploaded v4:
https://inbox.sourceware.org/gcc-patches/20241114123713.4046367-1-yury.khrusta...@arm.com/
.
* gcc.target/aarch64/indirect_return-2.c: New test.
* gcc.target/aarch64/indirect_return-3.c: New test.
Co-authored-by: Yury Khrustalev
---
gcc/doc/extend.texi | 10
.../gcc.target/aarch64/indirect_return-1.c| 53 +++
.../gcc.target/aarch64
(aarch_fun_is_indirect_return): New.
Co-authored-by: Yury Khrustalev
---
gcc/config/aarch64/aarch64-opts.h| 2 +
gcc/config/aarch64/aarch64-protos.h | 2 +-
gcc/config/aarch64/aarch64.cc| 62
gcc/config/aarch64/aarch64.h | 1 +
gcc/config/aarch64
From: Szabolcs Nagy
libgcc/ChangeLog:
* config/aarch64/aarch64-asm.h (FEATURE_1_GCS): Define.
(GCS_FLAG): Define if GCS is enabled.
(GNU_PROPERTY): Add GCS_FLAG.
---
libgcc/config/aarch64/aarch64-asm.h | 16 ++--
1 file changed, 14 insertions(+), 2 deletions(
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/gcs-nonlocal-3.c: New test.
* gcc.target/aarch64/sme/nonlocal_goto_4.c: Update.
* gcc.target/aarch64/sme/nonlocal_goto_5.c: Update.
* gcc.target/aarch64/sme/nonlocal_goto_6.c: Update.
---
.../gcc.target/aarch64/gcs-nonlo
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/acle/gcs-1.c: New test.
* gcc.target/aarch64/gcspopm-1.c: New test.
* gcc.target/aarch64/gcspr-1.c: New test.
* gcc.target/aarch64/gcsss-1.c: New test.
Co-authored-by: Yury Khrustalev
---
gcc
From: Matthieu Longo
gcc/testsuite/ChangeLog:
* g++.target/aarch64/return_address_sign_ab_exception.C: Update.
* gcc.target/aarch64/eh_return.c: Update.
---
.../return_address_sign_ab_exception.C| 19 +--
gcc/testsuite/gcc.target/aarch64/eh_return.c | 13
Add the following ACLE intrinsics:
- void *__gcspr(void);
- uint64_t __gcspopm(void);
- void *__gcsss(void *);
gcc/ChangeLog:
* config/aarch64/arm_acle.h (__gcspr): New.
(__gcspopm): New.
(__gcsss): New.
---
gcc/config/aarch64/arm_acle.h | 9 +
1 file changed,
From: Szabolcs Nagy
Follows the current linux ABI that uses single signal entry token
and shared shadow stack between thread and alt stack.
Could be behind __ARM_FEATURE_GCS_DEFAULT ifdef (only do anything
special with gcs compat codegen) but there is a runtime check anyway.
Change affected test
From: Szabolcs Nagy
Add new builtins for GCS:
void *__builtin_aarch64_gcspr (void)
uint64_t __builtin_aarch64_gcspopm (void)
void *__builtin_aarch64_gcsss (void *)
The builtins are always enabled, but should be used behind runtime
checks in case the target does not support GCS. They are t
From: Szabolcs Nagy
Add instructions for the Guarded Control Stack extension.
GCSSS1 and GCSSS2 are always used together in the compiler and an extra
"mov xn, 0" should be always added before GCSSS2 to clear the output
register. This is needed to get reasonable result when GCS is disabled,
when
Note that compared to __builtin_aarch64_chkfeat (x) the ACLE __chkfeat(x)
flips the bits to be more intuitive (xor the input to output).
gcc/ChangeLog:
* config/aarch64/arm_acle.h (__chkfeat): New.
---
gcc/config/aarch64/arm_acle.h | 13 +
1 file changed, 13 insertions(+)
dif
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pragma_cpp_predefs_4.c: Add gcs specific
tests.
---
.../gcc.target/aarch64/pragma_cpp_predefs_4.c | 35 +++
1 file changed, 35 insertions(+)
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cp
From: Szabolcs Nagy
These are scan asm tests only, relying on existing execution tests
for runtime coverage.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/gcs-nonlocal-1.c: New test.
* gcc.target/aarch64/gcs-nonlocal-1-track-speculation.c: New test.
* gcc.target/aarch64/
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/acle/chkfeat-1.c: New test.
* gcc.target/aarch64/chkfeat-1.c: New test.
* gcc.target/aarch64/chkfeat-2.c: New test.
Co-authored-by: Yury Khrustalev
Co-authored-by: Richard Sandiford
---
.../gcc.target
From: Szabolcs Nagy
Builtin for chkfeat: the input argument is used to initialize x16 then
execute chkfeat and return the updated x16.
Note: the ACLE __chkfeat(x) will flip the bits to be more intuitive
(xor the input to output), but for the builtin that seems unnecessary
complication.
gcc/Chan
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pragma_cpp_predefs_4.c: Add branch-protection
tests.
---
.../gcc.target/aarch64/pragma_cpp_predefs_4.c | 50 +++
1 file changed, 50 insertions(+)
diff --git a/gcc/testsuite/gcc.target/aarch64/prag
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pragma_cpp_predefs_1.c: GCS test.
---
.../gcc.target/aarch64/pragma_cpp_predefs_1.c | 30 +++
1 file changed, 30 insertions(+)
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_1.c
b/gcc/t
From: Szabolcs Nagy
Nonlocal stack save and restore has to also save and restore the GCS
pointer. This is used in __builtin_setjmp/longjmp and nonlocal goto.
The GCS specific code is only emitted if GCS branch-protection is
enabled and the code always checks at runtime if GCS is enabled.
The ne
From: Szabolcs Nagy
This is a hint space instruction to check for enabled HW features and
update the x16 register accordingly.
Use unspec_volatile to prevent reordering it around calls since calls
can enable or disable HW features.
gcc/ChangeLog:
* config/aarch64/aarch64.md (aarch64_ch
From: Szabolcs Nagy
This enables Guarded Control Stack (GCS) compatible code generation.
The "standard" branch-protection type enables it, and the default
depends on the compiler default.
gcc/ChangeLog:
* config/aarch64/aarch64-protos.h (aarch_gcs_enabled): Declare.
* config/aa
GCS marking to asm
aarch64: Introduce indirect_return attribute
Yury Khrustalev (3):
aarch64: Add ACLE __chkfeat intrinsic
aarch64: Add ACLE __gcs* intrinsics
aarch64: Fix nonlocal goto tests incompatible with GCS
gcc/config/aarch64/aarch64-builtins.cc| 92
gcc
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/gcs-nonlocal-3.c: New test.
* gcc.target/aarch64/sme/nonlocal_goto_4.c: Update.
* gcc.target/aarch64/sme/nonlocal_goto_5.c: Update.
* gcc.target/aarch64/sme/nonlocal_goto_6.c: Update.
---
.../gcc.target/aarch64/gcs-nonlo
From: Matthieu Longo
gcc/testsuite/ChangeLog:
* g++.target/aarch64/return_address_sign_ab_exception.C: Update.
* gcc.target/aarch64/eh_return.c: Update.
---
.../return_address_sign_ab_exception.C| 19 +--
gcc/testsuite/gcc.target/aarch64/eh_return.c | 13
.
* config/arm/aarch-common-protos.h
(aarch_fun_is_indirect_return): New.
* config/arm/arm.cc
(aarch_fun_is_indirect_return): New.
Co-authored-by: Yury Khrustalev
---
gcc/config/aarch64/aarch64-opts.h| 2 ++
gcc/config/aarch64/aarch64-protos.h | 2 +-
gcc/config/aarch64
From: Szabolcs Nagy
gcc/ChangeLog:
* config/aarch64/aarch64.cc (GNU_PROPERTY_AARCH64_FEATURE_1_GCS):
Define.
(aarch64_file_end_indicate_exec_stack): Set GCS property bit.
---
gcc/config/aarch64/aarch64.cc | 5 +
1 file changed, 5 insertions(+)
diff --git a/gcc/confi
From: Szabolcs Nagy
libatomic/ChangeLog:
* config/linux/aarch64/atomic_16.S (FEATURE_1_GCS): Define.
(GCS_FLAG): Define if GCS is enabled.
(GNU_PROPERTY): Add GCS_FLAG.
---
libatomic/config/linux/aarch64/atomic_16.S | 11 +--
1 file changed, 9 insertions(+), 2 de
From: Szabolcs Nagy
libgcc/ChangeLog:
* config/aarch64/aarch64-asm.h (FEATURE_1_GCS): Define.
(GCS_FLAG): Define if GCS is enabled.
(GNU_PROPERTY): Add GCS_FLAG.
---
libgcc/config/aarch64/aarch64-asm.h | 16 ++--
1 file changed, 14 insertions(+), 2 deletions(
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pragma_cpp_predefs_4.c: Add gcs specific
tests.
---
.../gcc.target/aarch64/pragma_cpp_predefs_4.c | 35 +++
1 file changed, 35 insertions(+)
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cp
.
* gcc.target/aarch64/indirect_return-2.c: New test.
Co-authored-by: Yury Khrustalev
---
gcc/doc/extend.texi | 10
.../gcc.target/aarch64/indirect_return-1.c| 53 +++
.../gcc.target/aarch64/indirect_return-2.c| 48 +
3 files changed, 111
From: Szabolcs Nagy
Follows the current linux ABI that uses single signal entry token
and shared shadow stack between thread and alt stack.
Could be behind __ARM_FEATURE_GCS_DEFAULT ifdef (only do anything
special with gcs compat codegen) but there is a runtime check anyway.
Change affected test
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/acle/gcs-1.c: New test.
* gcc.target/aarch64/gcspopm-1.c: New test.
* gcc.target/aarch64/gcspr-1.c: New test.
* gcc.target/aarch64/gcsss-1.c: New test.
Co-authored-by: Yury Khrustalev
---
gcc
From: Szabolcs Nagy
These are scan asm tests only, relying on existing execution tests
for runtime coverage.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/gcs-nonlocal-1.c: New test.
* gcc.target/aarch64/gcs-nonlocal-1-track-speculation.c: New test.
* gcc.target/aarch64/
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pragma_cpp_predefs_1.c: GCS test.
---
.../gcc.target/aarch64/pragma_cpp_predefs_1.c | 30 +++
1 file changed, 30 insertions(+)
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_1.c
b/gcc/t
From: Szabolcs Nagy
Add instructions for the Guarded Control Stack extension.
GCSSS1 and GCSSS2 are always used together in the compiler and an extra
"mov xn, 0" should be always added before GCSSS2 to clear the output
register. This is needed to get reasonable result when GCS is disabled,
when
From: Szabolcs Nagy
gcc/ChangeLog:
* config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Define
macros for GCS.
---
gcc/config/aarch64/aarch64-c.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc
ind
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/acle/chkfeat-1.c: New test.
* gcc.target/aarch64/chkfeat-1.c: New test.
* gcc.target/aarch64/chkfeat-2.c: New test.
Co-authored-by: Yury Khrustalev
Co-authored-by: Richard Sandiford
---
.../gcc.target
Note that compared to __builtin_aarch64_chkfeat (x) the ACLE __chkfeat(x)
flips the bits to be more intuitive (xor the input to output).
gcc/ChangeLog:
* config/aarch64/arm_acle.h (__chkfeat): New.
---
gcc/config/aarch64/arm_acle.h | 13 +
1 file changed, 13 insertions(+)
dif
From: Szabolcs Nagy
Nonlocal stack save and restore has to also save and restore the GCS
pointer. This is used in __builtin_setjmp/longjmp and nonlocal goto.
The GCS specific code is only emitted if GCS branch-protection is
enabled and the code always checks at runtime if GCS is enabled.
The ne
Add the following ACLE intrinsics:
- void *__gcspr(void);
- uint64_t __gcspopm(void);
- void *__gcsss(void *);
gcc/ChangeLog:
* config/aarch64/arm_acle.h (__gcspr): New.
(__gcspopm): New.
(__gcsss): New.
---
gcc/config/aarch64/arm_acle.h | 9 +
1 file changed,
From: Szabolcs Nagy
Add new builtins for GCS:
void *__builtin_aarch64_gcspr (void)
uint64_t __builtin_aarch64_gcspopm (void)
void *__builtin_aarch64_gcsss (void *)
The builtins are always enabled, but should be used behind runtime
checks in case the target does not support GCS. They are t
From: Szabolcs Nagy
This enables Guarded Control Stack (GCS) compatible code generation.
The "standard" branch-protection type enables it, and the default
depends on the compiler default.
gcc/ChangeLog:
* config/aarch64/aarch64-protos.h (aarch_gcs_enabled): Declare.
* config/aa
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pragma_cpp_predefs_4.c: Add branch-protection
tests.
---
.../gcc.target/aarch64/pragma_cpp_predefs_4.c | 50 +++
1 file changed, 50 insertions(+)
diff --git a/gcc/testsuite/gcc.target/aarch64/prag
From: Szabolcs Nagy
Builtin for chkfeat: the input argument is used to initialize x16 then
execute chkfeat and return the updated x16.
Note: the ACLE __chkfeat(x) will flip the bits to be more intuitive
(xor the input to output), but for the builtin that seems unnecessary
complication.
gcc/Chan
From: Szabolcs Nagy
This is a hint space instruction to check for enabled HW features and
update the x16 register accordingly.
Use unspec_volatile to prevent reordering it around calls since calls
can enable or disable HW features.
gcc/ChangeLog:
* config/aarch64/aarch64.md (aarch64_ch
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: Introduce indirect_return attribute
Yury Khrustalev (3):
aarch64: Add ACLE __chkfeat intrinsic
aarch64: Add ACLE __gcs* intrinsics
Hi Kyrill,
On Thu, Oct 31, 2024 at 02:05:00PM +, Kyrylo Tkachov wrote:
> Hi Yury,
>
> > On 31 Oct 2024, at 14:23, Yury Khrustalev wrote:
> >
> > From: Szabolcs Nagy
> >
> > Add new builtins for GCS:
> >
> > void *__builtin_aarch64_gcsp
Hello Kyrill,
On Thu, Oct 31, 2024 at 02:11:02PM +, Kyrylo Tkachov wrote:
>
>
> > On 31 Oct 2024, at 14:23, Yury Khrustalev wrote:
> >
> > From: Szabolcs Nagy
> >
> > Builtin for chkfeat: the input argument is used to initialize x16 then
> >
Hi Richard,
On Thu, Oct 24, 2024 at 05:27:24PM +0100, Richard Sandiford wrote:
> Yury Khrustalev writes:
> > From: Szabolcs Nagy
>
> Could you explain these testsuite changes in more detail? It seems
> on the face of it that they're changing the tests to test som
Hi Richard,
On Thu, Oct 24, 2024 at 06:18:23PM +0100, Richard Sandiford wrote:
> Yury Khrustalev writes:
> > From: Szabolcs Nagy
> >
> > Tail calls of indirect_return functions from non-indirect_return
> > functions are disallowed even if BTI is disabled, since the
From: Szabolcs Nagy
These are scan asm tests only, relying on existing execution tests
for runtime coverage.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/gcs-nonlocal-1.c: New test.
* gcc.target/aarch64/gcs-nonlocal-1-track-speculation.c: New test.
* gcc.target/aarch64/
From: Szabolcs Nagy
gcc/ChangeLog:
* config/aarch64/aarch64.cc (GNU_PROPERTY_AARCH64_FEATURE_1_GCS):
Define.
(aarch64_file_end_indicate_exec_stack): Set GCS property bit.
---
gcc/config/aarch64/aarch64.cc | 5 +
1 file changed, 5 insertions(+)
diff --git a/gcc/confi
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/gcs-nonlocal-3.c: New test.
* gcc.target/aarch64/sme/nonlocal_goto_4.c: Update.
* gcc.target/aarch64/sme/nonlocal_goto_5.c: Update.
* gcc.target/aarch64/sme/nonlocal_goto_6.c: Update.
---
.../gcc.target/aarch64/gcs-nonlo
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/gcspopm-1.c: New test.
* gcc.target/aarch64/gcspr-1.c: New test.
* gcc.target/aarch64/gcsss-1.c: New test.
---
gcc/testsuite/gcc.target/aarch64/gcspopm-1.c | 63
gcc/testsuite/gcc.targ
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/chkfeat-1.c: New test.
* gcc.target/aarch64/chkfeat-2.c: New test.
Co-authored-by: Richard Sandiford
---
gcc/testsuite/gcc.target/aarch64/chkfeat-1.c | 75
gcc/testsuite/gcc.target/aa
From: Szabolcs Nagy
This enables Guarded Control Stack (GCS) compatible code generation.
The "standard" branch-protection type enables it, and the default
depends on the compiler default.
gcc/ChangeLog:
* config/aarch64/aarch64-protos.h (aarch_gcs_enabled): Declare.
* config/aa
From: Matthieu Longo
gcc/testsuite/ChangeLog:
* g++.target/aarch64/return_address_sign_ab_exception.C: Update.
* gcc.target/aarch64/eh_return.c: Update.
---
.../return_address_sign_ab_exception.C| 19 +--
gcc/testsuite/gcc.target/aarch64/eh_return.c | 13
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pragma_cpp_predefs_1.c: GCS test.
---
.../gcc.target/aarch64/pragma_cpp_predefs_1.c | 30 +++
1 file changed, 30 insertions(+)
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_1.c
b/gcc/t
On Thu, Oct 24, 2024 at 06:47:07PM +0100, Richard Sandiford wrote:
> Yury Khrustalev writes:
> > This patch series adds support for the Guarded Control Stack extension.
> >
>
> Thanks for this. I've replied to some individual patches, but the
> ones I didn't re
On Thu, Oct 24, 2024 at 05:53:45PM +0100, Richard Sandiford wrote:
> Yury Khrustalev writes:
> > From: Szabolcs Nagy
> >
> Don't we still need to pop from the current stack up to the switch point,
> in case something further up the call frame wants to switch back to it?
From: Szabolcs Nagy
libatomic/ChangeLog:
* config/linux/aarch64/atomic_16.S (FEATURE_1_GCS): Define.
(GCS_FLAG): Define if GCS is enabled.
(GNU_PROPERTY): Add GCS_FLAG.
---
libatomic/config/linux/aarch64/atomic_16.S | 11 +--
1 file changed, 9 insertions(+), 2 de
From: Szabolcs Nagy
Tail calls of indirect_return functions from non-indirect_return
functions are disallowed even if BTI is disabled, since the call
site may have BTI enabled.
Following x86, mismatching attribute on function pointers is not
a type error even though this can lead to bugs.
Neede
.
* gcc.target/aarch64/indirect_return-2.c: New test.
Co-authored-by: Yury Khrustalev
---
gcc/doc/extend.texi | 10
.../gcc.target/aarch64/indirect_return-1.c| 53 +++
.../gcc.target/aarch64/indirect_return-2.c| 48 +
3 files changed, 111
From: Szabolcs Nagy
gcc/ChangeLog:
* config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Define
macros for GCS.
---
gcc/config/aarch64/aarch64-c.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc
ind
From: Szabolcs Nagy
Add new builtins for GCS:
void *__builtin_aarch64_gcspr (void)
uint64_t __builtin_aarch64_gcspopm (void)
void *__builtin_aarch64_gcsss (void *)
The builtins are always enabled, but should be used behind runtime
checks in case the target does not support GCS. They are t
From: Szabolcs Nagy
Follows the current linux ABI that uses single signal entry token
and shared shadow stack between thread and alt stack.
Could be behind __ARM_FEATURE_GCS_DEFAULT ifdef (only do anything
special with gcs compat codegen) but there is a runtime check anyway.
Change affected test
From: Szabolcs Nagy
Nonlocal stack save and restore has to also save and restore the GCS
pointer. This is used in __builtin_setjmp/longjmp and nonlocal goto.
The GCS specific code is only emitted if GCS branch-protection is
enabled and the code always checks at runtime if GCS is enabled.
The ne
From: Szabolcs Nagy
libgcc/ChangeLog:
* config/aarch64/aarch64-asm.h (FEATURE_1_GCS): Define.
(GCS_FLAG): Define if GCS is enabled.
(GNU_PROPERTY): Add GCS_FLAG.
---
libgcc/config/aarch64/aarch64-asm.h | 16 ++--
1 file changed, 14 insertions(+), 2 deletions(
From: Szabolcs Nagy
Builtin for chkfeat: the input argument is used to initialize x16 then
execute chkfeat and return the updated x16.
Note: ACLE __chkfeat(x) plans to flip the bits to be more intuitive
(xor the input to output), but for the builtin that seems unnecessary
complication.
gcc/Chan
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pragma_cpp_predefs_4.c: Add gcs specific
tests.
---
.../gcc.target/aarch64/pragma_cpp_predefs_4.c | 35 +++
1 file changed, 35 insertions(+)
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cp
From: Szabolcs Nagy
Add instructions for the Guarded Control Stack extension.
GCSSS1 and GCSSS2 are always used together in the compiler and an extra
"mov xn, 0" should be always added before GCSSS2 to clear the output
register. This is needed to get reasonable result when GCS is disabled,
when
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pragma_cpp_predefs_4.c: Add branch-protection
tests.
---
.../gcc.target/aarch64/pragma_cpp_predefs_4.c | 50 +++
1 file changed, 50 insertions(+)
diff --git a/gcc/testsuite/gcc.target/aarch64/prag
From: Szabolcs Nagy
This is a hint space instruction to check for enabled HW features and
update the x16 register accordingly.
Use unspec_volatile to prevent reordering it around calls since calls
can enable or disable HW features.
gcc/ChangeLog:
* config/aarch64/aarch64.md (aarch64_ch
attribute
Yury Khrustalev (1):
aarch64: Fix nonlocal goto tests incompatible with GCS
gcc/config/aarch64/aarch64-builtins.cc| 95 +
gcc/config/aarch64/aarch64-c.cc | 3 +
gcc/config/aarch64/aarch64-protos.h | 2 +
gcc/config/aarch64/aarch64.cc
On Thu, Oct 24, 2024 at 05:31:58PM +0100, Richard Sandiford wrote:
> Yury Khrustalev writes:
> > From: Szabolcs Nagy
> >
> > libgcc/ChangeLog:
> >
> > * config/aarch64/aarch64-asm.h (FEATURE_1_GCS): Define.
> > (GCS_FLAG): Define if GCS is enable
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/gcs-nonlocal-3.c: New test.
* gcc.target/aarch64/sme/nonlocal_goto_4.c: Update.
* gcc.target/aarch64/sme/nonlocal_goto_5.c: Update.
* gcc.target/aarch64/sme/nonlocal_goto_6.c: Update.
---
.../gcc.target/aarch64/gcs-nonlo
From: Szabolcs Nagy
Tail calls of indirect_return functions from non-indirect_return
functions are disallowed even if BTI is disabled, since the call
site may have BTI enabled.
Following x86, mismatching attribute on function pointers is not
a type error even though this can lead to bugs.
Neede
From: Szabolcs Nagy
Follows the current linux ABI that uses single signal entry token
and shared shadow stack between thread and alt stack.
Could be behind __ARM_FEATURE_GCS_DEFAULT ifdef (only do anything
special with gcs compat codegen) but there is a runtime check anyway.
Change affected test
From: Szabolcs Nagy
Transaction begin and abort use setjmp/longjmp like operations that
need to be updated for GCS compatibility. We use similar logic to
libc setjmp/longjmp that support switching stack and thus switching
GCS (e.g. due to longjmp out of a makecontext stack), this is kept
even tho
From: Matthieu Longo
gcc/testsuite/ChangeLog:
* g++.target/aarch64/return_address_sign_ab_exception.C: Update.
* gcc.target/aarch64/eh_return.c: Update.
---
.../return_address_sign_ab_exception.C| 19 +--
gcc/testsuite/gcc.target/aarch64/eh_return.c | 13
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pragma_cpp_predefs_1.c: GCS test.
---
.../gcc.target/aarch64/pragma_cpp_predefs_1.c | 30 +++
1 file changed, 30 insertions(+)
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_1.c
b/gcc/t
From: Szabolcs Nagy
libgcc/ChangeLog:
* config/aarch64/aarch64-asm.h (FEATURE_1_GCS): Define.
(GCS_FLAG): Define if GCS is enabled.
(GNU_PROPERTY): Add GCS_FLAG.
---
libgcc/config/aarch64/aarch64-asm.h | 16 ++--
1 file changed, 14 insertions(+), 2 deletions(
From: Szabolcs Nagy
Add new builtins for GCS:
void *__builtin_aarch64_gcspr (void)
uint64_t __builtin_aarch64_gcspopm (void)
void *__builtin_aarch64_gcsss (void *)
The builtins are always enabled, but should be used behind runtime
checks in case the target does not support GCS. They are t
From: Szabolcs Nagy
libatomic/ChangeLog:
* config/linux/aarch64/atomic_16.S (FEATURE_1_GCS): Define.
(GCS_FLAG): Define if GCS is enabled.
(GNU_PROPERTY): Add GCS_FLAG.
---
libatomic/config/linux/aarch64/atomic_16.S | 11 +--
1 file changed, 9 insertions(+), 2 de
From: Szabolcs Nagy
These are scan asm tests only, relying on existing execution tests
for runtime coverage.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/gcs-nonlocal-1.c: New test.
* gcc.target/aarch64/gcs-nonlocal-2.c: New test.
---
.../gcc.target/aarch64/gcs-nonlocal-1.c
-authored-by: Yury Khrustalev
---
gcc/doc/extend.texi | 5
.../gcc.target/aarch64/indirect_return.c | 25 +++
2 files changed, 30 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/aarch64/indirect_return.c
diff --git a/gcc/doc/extend.texi b
From: Szabolcs Nagy
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pragma_cpp_predefs_4.c: Add gcs specific
tests.
---
.../gcc.target/aarch64/pragma_cpp_predefs_4.c | 35 +++
1 file changed, 35 insertions(+)
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cp
From: Szabolcs Nagy
Nonlocal stack save and restore has to also save and restore the GCS
pointer. This is used in __builtin_setjmp/longjmp and nonlocal goto.
The GCS specific code is only emitted if GCS branch-protection is
enabled and the code always checks at runtime if GCS is enabled.
The ne
1 - 100 of 113 matches
Mail list logo