unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Michael Jeanson <mjeanson@efficios.com>
To: libc-alpha@sourceware.org
Cc: Michael Jeanson <mjeanson@efficios.com>,
	Florian Weimer <fweimer@redhat.com>,
	Carlos O'Donell <carlos@redhat.com>, DJ Delorie <dj@redhat.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: [PATCH v10 4/4] nptl: Add features to internal 'struct rseq_area'
Date: Mon, 25 Mar 2024 14:29:27 -0400	[thread overview]
Message-ID: <20240325182927.914830-5-mjeanson@efficios.com> (raw)
In-Reply-To: <20240325182927.914830-1-mjeanson@efficios.com>

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
test.

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 *
-- 
2.34.1


      parent reply	other threads:[~2024-03-25 18:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 18:29 [PATCH v10 0/4] Extend rseq support Michael Jeanson
2024-03-25 18:29 ` [PATCH v10 1/4] nptl: fix potential merge of __rseq_* relro symbols Michael Jeanson
2024-03-25 18:29 ` [PATCH v10 2/4] Add rseq extensible ABI support Michael Jeanson
2024-03-25 18:29 ` [PATCH v10 3/4] nptl: Add public __rseq_feature_size symbol Michael Jeanson
2024-03-25 18:29 ` Michael Jeanson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240325182927.914830-5-mjeanson@efficios.com \
    --to=mjeanson@efficios.com \
    --cc=carlos@redhat.com \
    --cc=dj@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=mathieu.desnoyers@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).