[v10,4/4] nptl: Add features to internal 'struct rseq_area'

Message ID 20240325182927.914830-5-mjeanson@efficios.com
State New
Series Extend rseq support |


Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Testing passed

Commit Message

Michael Jeanson March 25, 2024, 6:29 p.m. UTC
  The 'struct rseq_area' is used to define the offset of the various
features available in the rseq ABI. Add fields that follow cpu_id
(rseq_cs, flags, node_id, mm_cid) in preparation for their use.

Access to features following the original rseq ABI 20 bytes (after
'flags') starting with 'node_id' must be gated by an rseq feature size

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
 sysdeps/unix/sysv/linux/rseq-internal.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


diff --git a/sysdeps/unix/sysv/linux/rseq-internal.h b/sysdeps/unix/sysv/linux/rseq-internal.h
index 4123072274..da98e44dad 100644
--- a/sysdeps/unix/sysv/linux/rseq-internal.h
+++ b/sysdeps/unix/sysv/linux/rseq-internal.h
@@ -28,13 +28,17 @@ 
 #include <ldsodefs.h>
 /* rseq area registered with the kernel.  Use a custom definition
-   here to isolate from kernel struct rseq changes.  The
-   implementation of sched_getcpu needs acccess to the cpu_id field;
-   the other fields are unused and not included here.  */
+   here to isolate from kernel struct rseq changes.  Access to fields
+   beyond the 20 bytes of the original ABI (after 'flags') must be gated
+   by a check of the feature size.  */
 struct rseq_area
   uint32_t cpu_id_start;
   uint32_t cpu_id;
+  uint64_t rseq_cs;
+  uint32_t flags;
+  uint32_t node_id;
+  uint32_t mm_cid;
 static inline struct rseq_area *