[PATCH v16 5/8] nptl: Introduce <rseq-access.h> for RSEQ_* accessors

Florian Weimer fweimer@redhat.com
Fri Jan 10 19:08:09 GMT 2025


* Michael Jeanson:

> In preparation to move the rseq area to the 'extra TLS' block, we need
> accessors based on the thread pointer and the rseq offset. The ONCE
> variant of the accessors ensures single-copy atomicity for loads and
> stores which is required for all fields once the registration is active.
>
> A separate header is required to allow including <atomic.h> which
> results in an include loop when added to <tcb-access.h>.
>
> Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> ---
> Changes since v15:
> - Rename VOLATILE macros to ONCE
> Changes since v14:
> - Update copyright year to 2025
> Changes since v13:
> - Ensure that the VOLATILE variant static assert on 64bit types
>   on 32bit architectures
> - Split to separate header to allow including 'atomic.h' without
>   an include loop
> - Move rtld_hidden_proto rseq symbols to a separate patch
> Changes since v12:
> - Split RSEQ_SET/GETMEM from THREAD_SET/GETMEM
> - Rename rseq_get_area() to RSEQ_SELF()
> - Add rtld_hidden_proto to __rseq_size and __rseq_offset
> ---
>  sysdeps/i386/nptl/rseq-access.h         | 98 +++++++++++++++++++++++++
>  sysdeps/nptl/rseq-access.h              | 56 ++++++++++++++
>  sysdeps/unix/sysv/linux/rseq-internal.h |  8 ++
>  sysdeps/x86_64/nptl/rseq-access.h       | 77 +++++++++++++++++++
>  4 files changed, 239 insertions(+)
>  create mode 100644 sysdeps/i386/nptl/rseq-access.h
>  create mode 100644 sysdeps/nptl/rseq-access.h
>  create mode 100644 sysdeps/x86_64/nptl/rseq-access.h

Looks okay to me.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Florian



More information about the Libc-alpha mailing list