]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: Add glibc.cpu.aarch64_gcs_policy
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 21 Dec 2023 15:14:08 +0000 (15:14 +0000)
committerYury Khrustalev <yury.khrustalev@arm.com>
Mon, 14 Oct 2024 12:16:02 +0000 (13:16 +0100)
policy sets how gcs tunable and gcs marking turns into gcs state:

0: state = tunable
1: state = marking ? tunable : (tunable && dlopen ? err : 0)
2: state = marking ? tunable : (tunable ? err : 0)

sysdeps/aarch64/dl-tunables.list
sysdeps/unix/sysv/linux/aarch64/cpu-features.c
sysdeps/unix/sysv/linux/aarch64/dl-procinfo.c

index c08be869326b69b54e1c112a9c787f3c5d77dd42..2a07a6216b16e976e3cfd57e63566fd4fc131329 100644 (file)
@@ -26,5 +26,10 @@ glibc {
       minval: 0
       default: 0
     }
+    aarch64_gcs_policy {
+      type: UINT_64
+      minval: 0
+      default: 0
+    }
   }
 }
index 4a63875b1984b4072440e4c74d729055c643c52c..925756d79e3068d46321e53c399fa218bd196e70 100644 (file)
@@ -178,6 +178,11 @@ init_cpu_features (struct cpu_features *cpu_features)
   cpu_features->mops = GLRO (dl_hwcap2) & HWCAP2_MOPS;
 
   if (GLRO (dl_hwcap) & HWCAP_GCS)
-    /* GCS status may be updated later by binary compatibility checks.  */
-    GL (dl_aarch64_gcs) = TUNABLE_GET (glibc, cpu, aarch64_gcs, uint64_t, 0);
+    {
+      /* GCS status may be updated later by binary compatibility checks.  */
+      GL (dl_aarch64_gcs) = TUNABLE_GET (glibc, cpu, aarch64_gcs, uint64_t, 0);
+      /* Fixed GCS policy.  */
+      GLRO (dl_aarch64_gcs_policy) =
+       TUNABLE_GET (glibc, cpu, aarch64_gcs_policy, uint64_t, 0);
+    }
 }
index 7af232de523e8e2cc95554a49fcf26842ad7ecaa..a9d5ee9df5981b44faab866d0dbaf4c091de1829 100644 (file)
@@ -54,6 +54,19 @@ PROCINFO_CLASS struct cpu_features _dl_aarch64_cpu_features
 # else
 ,
 # endif
+# if !defined PROCINFO_DECL && defined SHARED
+  ._dl_aarch64_gcs_policy
+# else
+PROCINFO_CLASS uint64_t _dl_aarch64_gcs_policy
+# endif
+# ifndef PROCINFO_DECL
+= 0
+# endif
+# if !defined SHARED || defined PROCINFO_DECL
+;
+# else
+,
+# endif
 #endif
 
 /* Number of HWCAP bits set.  */