mbox series

[0/5] Restartable Sequences support for glibc

Message ID 20190614152304.12321-1-mathieu.desnoyers@efficios.com
Headers show
Series Restartable Sequences support for glibc | expand

Message

Mathieu Desnoyers June 14, 2019, 3:22 p.m. UTC
Hi,

This patchset implements basic support for the "rseq" Linux system call
in glibc by registering the rseq TLS abi.

One patch in this series modifies sched_getcpu() to speed up reading the
current CPU number by reading __rseq_abi.cpu_id when rseq is available.

It takes into account the last round of feedback that was received.

Please consider for inclusion into glibc,

Thanks,

Mathieu

Mathieu Desnoyers (5):
  glibc: Perform rseq(2) registration at C startup and thread creation
    (v11)
  glibc: sched_getcpu(): use rseq cpu_id TLS on Linux (v5)
  support record failure: allow use from constructor
  support: implement xpthread key create/delete (v2)
  rseq registration tests (v5)

 ChangeLog                                     |  96 +++++
 NEWS                                          |  15 +
 csu/libc-start.c                              |  14 +-
 elf/dl-support.c                              |  22 ++
 elf/rtld.c                                    |  26 ++
 misc/rseq-internal.h                          |  38 ++
 nptl/pthread_create.c                         |   9 +
 support/Makefile                              |   2 +
 support/check.h                               |   4 +
 support/support_record_failure.c              |  18 +-
 support/xpthread_key_create.c                 |  25 ++
 support/xpthread_key_delete.c                 |  24 ++
 support/xthread.h                             |   2 +
 sysdeps/unix/sysv/linux/Makefile              |   8 +-
 sysdeps/unix/sysv/linux/Versions              |  10 +
 sysdeps/unix/sysv/linux/aarch64/bits/rseq.h   |  43 ++
 sysdeps/unix/sysv/linux/aarch64/ld.abilist    |   1 +
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |   1 +
 sysdeps/unix/sysv/linux/alpha/ld.abilist      |   1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |   1 +
 sysdeps/unix/sysv/linux/arm/ld.abilist        |   1 +
 sysdeps/unix/sysv/linux/arm/libc.abilist      |   1 +
 sysdeps/unix/sysv/linux/bits/rseq.h           |  29 ++
 sysdeps/unix/sysv/linux/csky/ld.abilist       |   1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |   1 +
 sysdeps/unix/sysv/linux/hppa/ld.abilist       |   1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |   1 +
 sysdeps/unix/sysv/linux/i386/ld.abilist       |   1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |   1 +
 sysdeps/unix/sysv/linux/ia64/ld.abilist       |   1 +
 sysdeps/unix/sysv/linux/ia64/libc.abilist     |   1 +
 .../unix/sysv/linux/m68k/coldfire/ld.abilist  |   1 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |   1 +
 .../unix/sysv/linux/m68k/m680x0/ld.abilist    |   1 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |   1 +
 sysdeps/unix/sysv/linux/microblaze/ld.abilist |   1 +
 .../unix/sysv/linux/microblaze/libc.abilist   |   1 +
 sysdeps/unix/sysv/linux/mips/bits/rseq.h      |  62 +++
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |   1 +
 .../unix/sysv/linux/mips/mips32/ld.abilist    |   1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |   1 +
 .../sysv/linux/mips/mips64/n32/ld.abilist     |   1 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |   1 +
 .../sysv/linux/mips/mips64/n64/ld.abilist     |   1 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |   1 +
 sysdeps/unix/sysv/linux/nios2/ld.abilist      |   1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist    |   1 +
 sysdeps/unix/sysv/linux/powerpc/bits/rseq.h   |  37 ++
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |   1 +
 .../sysv/linux/powerpc/powerpc32/ld.abilist   |   1 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |   1 +
 .../linux/powerpc/powerpc64/be/ld.abilist     |   1 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |   1 +
 .../linux/powerpc/powerpc64/le/ld.abilist     |   1 +
 .../linux/powerpc/powerpc64/le/libc.abilist   |   1 +
 sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist |   1 +
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |   1 +
 sysdeps/unix/sysv/linux/rseq-internal.h       |  88 +++++
 sysdeps/unix/sysv/linux/rseq-sym.c            |  43 ++
 sysdeps/unix/sysv/linux/s390/bits/rseq.h      |  37 ++
 .../unix/sysv/linux/s390/s390-32/ld.abilist   |   1 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |   1 +
 .../unix/sysv/linux/s390/s390-64/ld.abilist   |   1 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist |   1 +
 sysdeps/unix/sysv/linux/sched_getcpu.c        |  25 +-
 sysdeps/unix/sysv/linux/sh/ld.abilist         |   1 +
 sysdeps/unix/sysv/linux/sh/libc.abilist       |   1 +
 .../unix/sysv/linux/sparc/sparc32/ld.abilist  |   1 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |   1 +
 .../unix/sysv/linux/sparc/sparc64/ld.abilist  |   1 +
 .../sysv/linux/sparc/sparc64/libc.abilist     |   1 +
 sysdeps/unix/sysv/linux/sys/rseq.h            |  52 +++
 sysdeps/unix/sysv/linux/tst-rseq-nptl.c       | 368 ++++++++++++++++++
 sysdeps/unix/sysv/linux/tst-rseq.c            | 122 ++++++
 sysdeps/unix/sysv/linux/x86/bits/rseq.h       |  30 ++
 sysdeps/unix/sysv/linux/x86_64/64/ld.abilist  |   1 +
 .../unix/sysv/linux/x86_64/64/libc.abilist    |   1 +
 sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist |   1 +
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |   1 +
 79 files changed, 1288 insertions(+), 13 deletions(-)
 create mode 100644 misc/rseq-internal.h
 create mode 100644 support/xpthread_key_create.c
 create mode 100644 support/xpthread_key_delete.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/rseq.h
 create mode 100644 sysdeps/unix/sysv/linux/bits/rseq.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/bits/rseq.h
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/rseq.h
 create mode 100644 sysdeps/unix/sysv/linux/rseq-internal.h
 create mode 100644 sysdeps/unix/sysv/linux/rseq-sym.c
 create mode 100644 sysdeps/unix/sysv/linux/s390/bits/rseq.h
 create mode 100644 sysdeps/unix/sysv/linux/sys/rseq.h
 create mode 100644 sysdeps/unix/sysv/linux/tst-rseq-nptl.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-rseq.c
 create mode 100644 sysdeps/unix/sysv/linux/x86/bits/rseq.h