]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: Add asm helpers for GCS
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Wed, 22 Feb 2023 14:35:00 +0000 (14:35 +0000)
committerYury Khrustalev <yury.khrustalev@arm.com>
Thu, 10 Oct 2024 12:40:34 +0000 (13:40 +0100)
The Guarded Control Stack instructions can be present even if the
hardware does not support the extension (runtime checked feature),
so the asm code should be backward compatible with old assemblers.

sysdeps/aarch64/sysdep.h

index 464674e89c54800ab966caab6d7bc7ca328f0505..661d9fe8c1160a276434cf210b8fbcec9fa12b91 100644 (file)
@@ -74,6 +74,13 @@ strip_pac (void *p)
 #define PACIASP                hint    25
 #define AUTIASP                hint    29
 
+/* Guarded Control Stack support.  */
+#define CHKFEAT_X16    hint    40
+#define MRS_GCSPR(x)   mrs     x, s3_3_c2_c5_1
+#define GCSPOPM(x)     sysl    x, #3, c7, c7, #1
+#define GCSSS1(x)      sys     #3, c7, c7, #2, x
+#define GCSSS2(x)      sysl    x, #3, c7, c7, #3
+
 /* GNU_PROPERTY_AARCH64_* macros from elf.h for use in asm code.  */
 #define FEATURE_1_AND 0xc0000000
 #define FEATURE_1_BTI 1