[PATCH] AArch64: Use bitfield in cpu_features struct (BZ #32279)

Wilco Dijkstra Wilco.Dijkstra@arm.com
Thu Oct 17 11:59:39 GMT 2024


To avoid increasing the size of the cpu_features struct, use bitfields for "sve" and 
"prefer_sve_ifuncs" fields.  Backporting this to 2.39 and older (but not 2.40) then
restores the original layout which is compatible with older dynamic linkers.
This avoids the issue reported in BZ 32279.

Passes regress, OK for backport?

---

diff --git a/sysdeps/aarch64/cpu-features.h b/sysdeps/aarch64/cpu-features.h
index bc8d8422388f9cf0a06673af58b39c50dcaa3ee1..0a7a03c1c51e165384eb43d2085fc5c46e0aae21 100644
--- a/sysdeps/aarch64/cpu-features.h
+++ b/sysdeps/aarch64/cpu-features.h
@@ -69,8 +69,8 @@ struct cpu_features
   bool bti;
   /* Currently, the GLIBC memory tagging tunable only defines 8 bits.  */
   uint8_t mte_state;
-  bool sve;
-  bool prefer_sve_ifuncs;
+  bool sve : 1;			/* Bitfield to avoid changing size of struct.  */
+  bool prefer_sve_ifuncs : 1;	/* Bitfield to avoid changing size of struct.  */
   bool mops;
 };
 


More information about the Libc-alpha mailing list