about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2023-02-22 14:35:00 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2024-07-08 09:41:43 +0100
commit38264693611573c873a7f16da29984085e3c0339 (patch)
tree158fd83f0c89736f7fe0fdfc3ac394164e375e6d
parent5cfb00207e87cf4272b09c1b3cbc7b81ddb9d3f9 (diff)
downloadglibc-38264693611573c873a7f16da29984085e3c0339.tar.gz
glibc-38264693611573c873a7f16da29984085e3c0339.tar.xz
glibc-38264693611573c873a7f16da29984085e3c0339.zip
aarch64: Add asm helpers for GCS
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.
-rw-r--r--sysdeps/aarch64/sysdep.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sysdeps/aarch64/sysdep.h b/sysdeps/aarch64/sysdep.h
index 464674e89c..661d9fe8c1 100644
--- a/sysdeps/aarch64/sysdep.h
+++ b/sysdeps/aarch64/sysdep.h
@@ -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