]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Linux: Remove rseq support
authorFlorian Weimer <fweimer@redhat.com>
Thu, 16 Jul 2020 15:55:35 +0000 (17:55 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 16 Jul 2020 15:55:35 +0000 (17:55 +0200)
The kernel ABI is not finalized, and there are now various proposals
to change the size of struct rseq, which would make the glibc ABI
dependent on the version of the kernels used for building glibc.
This is of course not acceptable.

This reverts commit 48699da1c468543ade14777819bd1b4d652709de ("elf:
Support at least 32-byte alignment in static dlopen"), commit
8f4632deb3545b2949cec5454afc3cb21a0024ea ("Linux: rseq registration
tests"), commit 6e29cb3f61ff5432c78a1c84b0d9b123a350ab36 ("Linux: Use
rseq in sched_getcpu if available"), and commit
0c76fc3c2b346dc5401dc055d97d4279632b0fb3 ("Linux: Perform rseq
registration at C startup and thread creation"), resolving the conflicts
introduced by the ARC port and the TLS static surplus changes.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
54 files changed:
NEWS
csu/libc-tls.c
elf/dl-tls.c
elf/libc_early_init.c
manual/threads.texi
nptl/pthread_create.c
sysdeps/generic/rseq-internal.h [deleted file]
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/Versions
sysdeps/unix/sysv/linux/aarch64/bits/rseq.h [deleted file]
sysdeps/unix/sysv/linux/aarch64/libc.abilist
sysdeps/unix/sysv/linux/alpha/libc.abilist
sysdeps/unix/sysv/linux/arc/libc.abilist
sysdeps/unix/sysv/linux/arm/be/libc.abilist
sysdeps/unix/sysv/linux/arm/bits/rseq.h [deleted file]
sysdeps/unix/sysv/linux/arm/le/libc.abilist
sysdeps/unix/sysv/linux/bits/rseq.h [deleted file]
sysdeps/unix/sysv/linux/csky/libc.abilist
sysdeps/unix/sysv/linux/hppa/libc.abilist
sysdeps/unix/sysv/linux/i386/libc.abilist
sysdeps/unix/sysv/linux/ia64/libc.abilist
sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
sysdeps/unix/sysv/linux/mips/bits/rseq.h [deleted file]
sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
sysdeps/unix/sysv/linux/nios2/libc.abilist
sysdeps/unix/sysv/linux/powerpc/bits/rseq.h [deleted file]
sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
sysdeps/unix/sysv/linux/rseq-internal.h [deleted file]
sysdeps/unix/sysv/linux/rseq-sym.c [deleted file]
sysdeps/unix/sysv/linux/s390/bits/rseq.h [deleted file]
sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
sysdeps/unix/sysv/linux/sched_getcpu.c
sysdeps/unix/sysv/linux/sh/be/libc.abilist
sysdeps/unix/sysv/linux/sh/le/libc.abilist
sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
sysdeps/unix/sysv/linux/sys/rseq.h [deleted file]
sysdeps/unix/sysv/linux/tst-rseq-nptl.c [deleted file]
sysdeps/unix/sysv/linux/tst-rseq.c [deleted file]
sysdeps/unix/sysv/linux/tst-rseq.h [deleted file]
sysdeps/unix/sysv/linux/x86/bits/rseq.h [deleted file]
sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist

diff --git a/NEWS b/NEWS
index 5051e804eaf2eb629897ee37aadf9e8e8558d582..1ef4a0a7a47809fbe98704c0142ede4d6d6b50cb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,16 +42,6 @@ Major new features:
   pthread_attr_getsigmask_np have been added.  They allow applications
   to specify the signal mask of a thread created with pthread_create.
 
-* Support for automatically registering threads with the Linux rseq
-  system call has been added.  This system call is implemented starting
-  from Linux 4.18.  The Restartable Sequences ABI accelerates user-space
-  operations on per-cpu data.  It allows user-space to perform updates
-  on per-cpu data without requiring heavy-weight atomic operations.
-  Automatically registering threads allows all libraries, including libc,
-  to make immediate use of the rseq support by using the documented ABI.
-  The GNU C Library manual has details on integration of Restartable
-  Sequences.
-
 * The GNU C Library now provides the header file <sys/single_threaded.h>
   which declares the variable __libc_single_threaded.  Applications are
   encouraged to use this variable for single-thread optimizations,
index 3f1655f2641959eb5056de03f73883e16a92b681..06e76bd395e41f62656aafb28df30a37cd6fd635 100644 (file)
@@ -112,12 +112,6 @@ __libc_setup_tls (void)
   size_t tcb_offset;
   const ElfW(Phdr) *phdr;
 
-  /* libc.so with rseq has TLS with 32-byte alignment.  Static dlopen
-     requires at least 32-byte alignment as well, otherwise loading
-     libc.so will always fail.  */
-  if (max_align < 32)
-    max_align = 32;
-
   struct link_map *main_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
 
   /* Look through the TLS segment if there is any.  */
index 772e70d0f6ac83303f68fefa75c54cfc2ff536b1..9a174270473cf24ceef2ccecf00880b722016cd1 100644 (file)
@@ -55,7 +55,7 @@
    but come on top when computing the number of namespaces.  */
 
 /* Size of initial-exec TLS in libc.so.  */
-#define LIBC_IE_TLS 192
+#define LIBC_IE_TLS 160
 /* Size of initial-exec TLS in libraries other than libc.so.
    This should be large enough to cover runtime libraries of the
    compiler such as libgomp and libraries in libc other than libc.so.  */
@@ -190,12 +190,6 @@ void
 _dl_determine_tlsoffset (void)
 {
   size_t max_align = TLS_TCB_ALIGN;
-  /* libc.so with rseq has TLS with 32-byte alignment.  Since TLS is
-     initialized before audit modules are loaded and slotinfo
-     information is available, this is not taken into account below in
-     the audit case.  */
-  max_align = MAX (max_align, 32U);
-
   size_t freetop = 0;
   size_t freebottom = 0;
 
index 86da66d5e01af08f639bdb71bc7b8a0dfda22338..725ab2f811fe1aac0a5cff2c0033deea5aaaa3d2 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <ctype.h>
 #include <libc-early-init.h>
-#include <rseq-internal.h>
 #include <sys/single_threaded.h>
 
 void
@@ -27,10 +26,6 @@ __libc_early_init (_Bool initial)
   /* Initialize ctype data.  */
   __ctype_init ();
 
-  /* Register rseq ABI to the kernel for the main program's libc.   */
-  if (initial)
-    rseq_register_current_thread ();
-
   /* Only the outer namespace is marked as single-threaded.  */
   __libc_single_threaded = initial;
 }
index 49f249ec484b82e04b6fadbf12a415a67b99f63f..4ab0622443fd8781f6c89c634ec0afb4064c6813 100644 (file)
@@ -629,8 +629,6 @@ the standard.
 * Waiting with Explicit Clocks::          Functions for waiting with an
                                           explicit clock specification.
 * Single-Threaded::                       Detecting single-threaded execution.
-* Restartable Sequences::                 Linux-specific Restartable Sequences
-                                          integration.
 @end menu
 
 @node Default Thread Attributes
@@ -958,68 +956,6 @@ application-created thread because future versions of @theglibc{} may
 create background threads after the first thread has been created, and
 the application has no way of knowning that these threads are present.
 
-@node Restartable Sequences
-@subsubsection Restartable Sequences
-
-This section describes Restartable Sequences integration for
-@theglibc{}.  This functionality is only available on Linux.
-
-@deftypevar {struct rseq} __rseq_abi
-@standards{Linux, sys/rseq.h}
-@Theglibc{} implements a @code{__rseq_abi} TLS symbol to interact with
-the Restartable Sequences system call.  The layout of this structure is
-defined by the @file{sys/rseq.h} header.  Registration of each thread's
-@code{__rseq_abi} is performed by @theglibc{} at library initialization
-and thread creation.  The manual for the rseq system call can be found
-at @uref{https://git.kernel.org/pub/scm/libs/librseq/librseq.git/tree/doc/man/rseq.2}.
-
-The main executable and shared libraries may either have an undefined
-@code{__rseq_abi} TLS symbol, or define their own, with the same
-declaration as the one present in @file{sys/rseq.h}.  The dynamic linker
-will ensure that only one of those available symbols will be used at
-runtime across the process.
-
-If the main executable or shared libraries observe an uninitialized
-@code{__rseq_abi.cpu_id} field (value @code{RSEQ_CPU_ID_UNINITIALIZED}),
-they may perform rseq registration to the kernel: this means either
-glibc was prevented from doing the registration, or an older glibc
-version, which does not include rseq support, is in use.  When the main
-executable or a library thus takes ownership of the registration, the
-memory used to hold the @code{__rseq_abi} TLS variable must stay
-allocated, and is not re-used, until the very end of the thread lifetime
-or until an explicit rseq unregistration for that thread is performed.
-It is not recommended to @code{dlclose} libraries owning the
-@code{__rseq_abi} TLS variable.
-
-Users of the @code{__rseq_abi} TLS symbol can store the address of a
-@code{struct rseq_cs} to the @code{__rseq_abi.rseq_cs} TLS variable,
-thus informing the kernel that it enters a Restartable Sequence critical
-section.  This pointer and the code areas it itself points to must not
-be left pointing to memory areas which are freed or re-used.  Several
-approaches can guarantee this.  If the application or library can
-guarantee that the memory used to hold the @code{struct rseq_cs} and the
-code areas it refers to are never freed or re-used, no special action
-must be taken.  Else, before that memory is re-used of freed, the
-application is responsible for setting the @code{__rseq_abi.rseq_cs} TLS
-variable to @code{NULL} in each thread's TLS to guarantee that it does
-not leak dangling references.  Because the application does not
-typically have knowledge of libraries' use of Restartable Sequences, it
-is recommended that libraries using Restartable Sequences which may end
-up freeing or re-using their memory set the @code{__rseq_abi.rseq_cs}
-TLS variable to @code{NULL} before returning from library functions
-which use Restartable Sequences.
-
-@end deftypevar
-
-@deftypevr Macro int RSEQ_SIG
-@standards{Linux, sys/rseq.h}
-Each supported architecture provides a @code{RSEQ_SIG} macro in
-@file{sys/rseq.h} which contains a signature.  That signature is
-expected to be present in the code before each Restartable Sequences
-abort handler.  Failure to provide the expected signature may terminate
-the process with a segmentation fault.
-@end deftypevr
-
 @c FIXME these are undocumented:
 @c pthread_atfork
 @c pthread_attr_destroy
index e05013e3172facce678964c7636a6a42f05dad6b..2cba3da38cfaba4c66abf3e5604d90d2d5fc22ee 100644 (file)
@@ -33,7 +33,6 @@
 #include <default-sched.h>
 #include <futex-internal.h>
 #include <tls-setup.h>
-#include <rseq-internal.h>
 #include "libioP.h"
 #include <sys/single_threaded.h>
 
@@ -386,9 +385,6 @@ START_THREAD_DEFN
   /* Initialize pointers to locale data.  */
   __ctype_init ();
 
-  /* Register rseq TLS to the kernel.  */
-  rseq_register_current_thread ();
-
 #ifndef __ASSUME_SET_ROBUST_LIST
   if (__set_robust_list_avail >= 0)
 #endif
@@ -585,15 +581,6 @@ START_THREAD_DEFN
      process is really dead since 'clone' got passed the CLONE_CHILD_CLEARTID
      flag.  The 'tid' field in the TCB will be set to zero.
 
-     rseq TLS is still registered at this point.  Rely on implicit
-     unregistration performed by the kernel on thread teardown.  This is not a
-     problem because the rseq TLS lives on the stack, and the stack outlives
-     the thread.  If TCB allocation is ever changed, additional steps may be
-     required, such as performing explicit rseq unregistration before
-     reclaiming the rseq TLS area memory.  It is NOT sufficient to block
-     signals because the kernel may write to the rseq area even without
-     signals.
-
      The exit code is zero since in case all threads exit by calling
      'pthread_exit' the exit status must be 0 (zero).  */
   __exit_thread ();
diff --git a/sysdeps/generic/rseq-internal.h b/sysdeps/generic/rseq-internal.h
deleted file mode 100644 (file)
index 16f1973..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Restartable Sequences internal API.  Stub version.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef RSEQ_INTERNAL_H
-#define RSEQ_INTERNAL_H
-
-static inline void
-rseq_register_current_thread (void)
-{
-}
-
-#endif /* rseq-internal.h */
index 1932ccf7df1ebfb4bd783d53dc4c8972c6711a9e..9b2a2530324a342002991295f533770471420bac 100644 (file)
@@ -41,7 +41,7 @@ update-syscall-lists: arch-syscall.h
 endif
 
 ifeq ($(subdir),csu)
-sysdep_routines += errno-loc rseq-sym
+sysdep_routines += errno-loc
 endif
 
 ifeq ($(subdir),assert)
@@ -94,19 +94,14 @@ sysdep_headers += sys/mount.h sys/acct.h \
                  bits/types/struct_semid_ds.h \
                  bits/types/struct_msqid_ds.h \
                  bits/types/struct_shmid_ds.h \
-                 bits/ipc-perm.h \
-                 sys/rseq.h bits/rseq.h
+                 bits/ipc-perm.h
 
 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
         tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
         test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
         tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
         tst-tgkill
-
-# tst-rseq is an internal test because it requires a definition of __NR_rseq
-# from the internal system call list.
-tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc \
-                 tst-rseq
+tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
 
 CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
 
@@ -307,8 +302,4 @@ endif
 
 ifeq ($(subdir),nptl)
 tests += tst-align-clone tst-getpid1
-
-# tst-rseq-nptl is an internal test because it requires a definition of
-# __NR_rseq from the internal system call list.
-tests-internal += tst-rseq-nptl
 endif
index f72741b7e5afb22ab861c71b7ec0c1d026ba3b11..c35f783e2a41e99522ad4f10053131dbe5612cd9 100644 (file)
@@ -168,7 +168,6 @@ libc {
     getdents64; gettid; tgkill;
   }
   GLIBC_2.32 {
-    __rseq_abi;
   }
   GLIBC_PRIVATE {
     # functions used in other libraries
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/rseq.h b/sysdeps/unix/sysv/linux/aarch64/bits/rseq.h
deleted file mode 100644 (file)
index b6f6e53..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Restartable Sequences Linux aarch64 architecture header.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYS_RSEQ_H
-# error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
-#endif
-
-/* RSEQ_SIG is a signature required before each abort handler code.
-
-   It is a 32-bit value that maps to actual architecture code compiled
-   into applications and libraries.  It needs to be defined for each
-   architecture.  When choosing this value, it needs to be taken into
-   account that generating invalid instructions may have ill effects on
-   tools like objdump, and may also have impact on the CPU speculative
-   execution efficiency in some cases.
-
-   aarch64 -mbig-endian generates mixed endianness code vs data:
-   little-endian code and big-endian data.  Ensure the RSEQ_SIG signature
-   matches code endianness.  */
-
-#define RSEQ_SIG_CODE  0xd428bc00  /* BRK #0x45E0.  */
-
-#ifdef __AARCH64EB__
-# define RSEQ_SIG_DATA 0x00bc28d4  /* BRK #0x45E0.  */
-#else
-# define RSEQ_SIG_DATA RSEQ_SIG_CODE
-#endif
-
-#define RSEQ_SIG       RSEQ_SIG_DATA
index 008a6c8e52bb43f5de984fd76466cac05e61cb3a..6cd61988b4e84baa624cac876999932bc13dd139 100644 (file)
@@ -2150,7 +2150,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 2cfc5733edcd862ed044259c65823f32d568d3db..8edb5deea1a6eb0ef77eaf9d9af9df5961cda702 100644 (file)
@@ -2232,7 +2232,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 0d1ce972299ea70a3d0523dfb208d8cf7afa141c..df13f49e15ee83774c462dba172eb3208a7ea224 100644 (file)
@@ -345,7 +345,6 @@ GLIBC_2.32 __res_nclose F
 GLIBC_2.32 __res_ninit F
 GLIBC_2.32 __res_randomid F
 GLIBC_2.32 __res_state F
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 __sbrk F
 GLIBC_2.32 __sched_cpualloc F
 GLIBC_2.32 __sched_cpucount F
index 0e1677b5a06f6ad09e7658a50a1724b1b96d10ee..7f4a146d2285a236423f7862f8ad28902f63cc36 100644 (file)
@@ -134,7 +134,6 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
diff --git a/sysdeps/unix/sysv/linux/arm/bits/rseq.h b/sysdeps/unix/sysv/linux/arm/bits/rseq.h
deleted file mode 100644 (file)
index 2bf780e..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Restartable Sequences Linux arm architecture header.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYS_RSEQ_H
-# error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
-#endif
-
-/*
-   RSEQ_SIG is a signature required before each abort handler code.
-
-   It is a 32-bit value that maps to actual architecture code compiled
-   into applications and libraries.  It needs to be defined for each
-   architecture.  When choosing this value, it needs to be taken into
-   account that generating invalid instructions may have ill effects on
-   tools like objdump, and may also have impact on the CPU speculative
-   execution efficiency in some cases.
-
-   - ARM little endian
-
-   RSEQ_SIG uses the udf A32 instruction with an uncommon immediate operand
-   value 0x5de3.  This traps if user-space reaches this instruction by mistake,
-   and the uncommon operand ensures the kernel does not move the instruction
-   pointer to attacker-controlled code on rseq abort.
-
-   The instruction pattern in the A32 instruction set is:
-
-   e7f5def3    udf    #24035    ; 0x5de3
-
-   This translates to the following instruction pattern in the T16 instruction
-   set:
-
-   little endian:
-   def3        udf    #243      ; 0xf3
-   e7f5        b.n    <7f5>
-
-   - ARMv6+ big endian (BE8):
-
-   ARMv6+ -mbig-endian generates mixed endianness code vs data: little-endian
-   code and big-endian data.  The data value of the signature needs to have its
-   byte order reversed to generate the trap instruction:
-
-   Data: 0xf3def5e7
-
-   Translates to this A32 instruction pattern:
-
-   e7f5def3    udf    #24035    ; 0x5de3
-
-   Translates to this T16 instruction pattern:
-
-   def3        udf    #243      ; 0xf3
-   e7f5        b.n    <7f5>
-
-   - Prior to ARMv6 big endian (BE32):
-
-   Prior to ARMv6, -mbig-endian generates big-endian code and data
-   (which match), so the endianness of the data representation of the
-   signature should not be reversed.  However, the choice between BE32
-   and BE8 is done by the linker, so we cannot know whether code and
-   data endianness will be mixed before the linker is invoked.  So rather
-   than try to play tricks with the linker, the rseq signature is simply
-   data (not a trap instruction) prior to ARMv6 on big endian.  This is
-   why the signature is expressed as data (.word) rather than as
-   instruction (.inst) in assembler.  */
-
-#ifdef __ARMEB__
-# define RSEQ_SIG    0xf3def5e7      /* udf    #24035    ; 0x5de3 (ARMv6+) */
-#else
-# define RSEQ_SIG    0xe7f5def3      /* udf    #24035    ; 0x5de3 */
-#endif
index e544ed75a40a7ede7ac5fb5c5b3fabbc5ab1badc..a83cc81958fe60b9476c075cb810d9a2013ede57 100644 (file)
@@ -131,7 +131,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
diff --git a/sysdeps/unix/sysv/linux/bits/rseq.h b/sysdeps/unix/sysv/linux/bits/rseq.h
deleted file mode 100644 (file)
index 014c08f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Restartable Sequences architecture header.  Stub version.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYS_RSEQ_H
-# error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
-#endif
-
-/* RSEQ_SIG is a signature required before each abort handler code.
-
-   It is a 32-bit value that maps to actual architecture code compiled
-   into applications and libraries.  It needs to be defined for each
-   architecture.  When choosing this value, it needs to be taken into
-   account that generating invalid instructions may have ill effects on
-   tools like objdump, and may also have impact on the CPU speculative
-   execution efficiency in some cases.  */
index 6bb8042657d82485b4599b6644cf7d0ed055c0ad..32887b1c58003bf78f45dfbf984771b7d91efba1 100644 (file)
@@ -2094,7 +2094,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index e0f8f29c40703ec0f918bc562fb63e983bb1f2b3..baf425072b04b5d2e1190fb41dee6e0184238130 100644 (file)
@@ -2053,7 +2053,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 155dd51e0de3f8c2a3c8029448c775a28c30c59e..8b0242a9b1ef45837d651eabb560c94f97180cac 100644 (file)
@@ -2219,7 +2219,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 8cc12aa326c61cbf4c002fb48a11d81056cbd11f..b6ba86dbe940db6df60d4b14c9b3fdf24279b9f1 100644 (file)
@@ -2085,7 +2085,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index e02a61591c03c0b9799bdf6bcc8bebdf7fae9b5e..e1f7e19de9f9407f780ef0bd9e607a493e84e76c 100644 (file)
@@ -135,7 +135,6 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 8e90d9744a05e9156f562d0d74e42cb55686491a..2d726097ca09c70d16951142cbae92698fffbc16 100644 (file)
@@ -2165,7 +2165,6 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 76e402cbf534f8196e60a1d7ad910ff4187cf977..7c78649e0361c52dc33d2438addf659ffd4494f2 100644 (file)
@@ -2145,7 +2145,6 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 8528547aa2b0e3c80736664f2d2de00ad282ecd5..da2194b4986fa8d15a84055ce0dabb6b21479310 100644 (file)
@@ -2142,7 +2142,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
diff --git a/sysdeps/unix/sysv/linux/mips/bits/rseq.h b/sysdeps/unix/sysv/linux/mips/bits/rseq.h
deleted file mode 100644 (file)
index fa945fc..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Restartable Sequences Linux mips architecture header.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYS_RSEQ_H
-# error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
-#endif
-
-/* RSEQ_SIG is a signature required before each abort handler code.
-
-   It is a 32-bit value that maps to actual architecture code compiled
-   into applications and libraries.  It needs to be defined for each
-   architecture.  When choosing this value, it needs to be taken into
-   account that generating invalid instructions may have ill effects on
-   tools like objdump, and may also have impact on the CPU speculative
-   execution efficiency in some cases.
-
-   RSEQ_SIG uses the break instruction.  The instruction pattern is:
-
-   On MIPS:
-        0350000d        break     0x350
-
-   On nanoMIPS:
-        00100350        break     0x350
-
-   On microMIPS:
-        0000d407        break     0x350
-
-   For nanoMIPS32 and microMIPS, the instruction stream is encoded as
-   16-bit halfwords, so the signature halfwords need to be swapped
-   accordingly for little-endian.  */
-
-#if defined (__nanomips__)
-# ifdef __MIPSEL__
-#  define RSEQ_SIG      0x03500010
-# else
-#  define RSEQ_SIG      0x00100350
-# endif
-#elif defined (__mips_micromips)
-# ifdef __MIPSEL__
-#  define RSEQ_SIG      0xd4070000
-# else
-#  define RSEQ_SIG      0x0000d407
-# endif
-#elif defined (__mips__)
-# define RSEQ_SIG       0x0350000d
-#else
-/* Unknown MIPS architecture.  */
-#endif
index 2b838c0c8e5a59db935093485927dbe5590905ba..9fa655b3a530856343c449176e4546bf3c25c29f 100644 (file)
@@ -2136,7 +2136,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 9cde04785c7980cc979494eff6dd6241a220705e..3f6da71769fc981045b68eace01095b1189ef732 100644 (file)
@@ -2134,7 +2134,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index be180e71cfdb50b27460e752dc6f2f654ed4667d..de990933cf06f7e2ec9412950b82f318896ce56e 100644 (file)
@@ -2142,7 +2142,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 8569cfb6cbd749397ae61581d9bf9810205817ce..754491f20957daca5856d4a97525df81023d03ba 100644 (file)
@@ -2136,7 +2136,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index bce6c79b9b4ec18e95ee1b1c7ead7adf8c59f46b..36a875115c82c9347707c5cfe692faf7ef8a6342 100644 (file)
@@ -2183,7 +2183,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/rseq.h b/sysdeps/unix/sysv/linux/powerpc/bits/rseq.h
deleted file mode 100644 (file)
index 0dc608e..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Restartable Sequences Linux powerpc architecture header.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYS_RSEQ_H
-# error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
-#endif
-
-/* RSEQ_SIG is a signature required before each abort handler code.
-
-   It is a 32-bit value that maps to actual architecture code compiled
-   into applications and libraries.  It needs to be defined for each
-   architecture.  When choosing this value, it needs to be taken into
-   account that generating invalid instructions may have ill effects on
-   tools like objdump, and may also have impact on the CPU speculative
-   execution efficiency in some cases.
-
-   RSEQ_SIG uses the following trap instruction:
-
-   powerpc-be:    0f e5 00 0b           twui   r5,11
-   powerpc64-le:  0b 00 e5 0f           twui   r5,11
-   powerpc64-be:  0f e5 00 0b           twui   r5,11  */
-
-#define RSEQ_SIG        0x0fe5000b
index 1d0158a08e140a4359f737f8089a2947b5ab2df4..6de9bed51d80f14bd86bb7c3578b4550d856ba15 100644 (file)
@@ -2192,7 +2192,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index f65772cf8abbf3eb0dd6f830861be87652cbf7cd..5c8c58974c936b576ae7777a9d0f9ab0adf12b0b 100644 (file)
@@ -2225,7 +2225,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index cfe526b916eab8bb25d684eb6c540b79f1cbccbf..92114806acd301649b8ca9ab42041b8a301379b0 100644 (file)
@@ -2055,7 +2055,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index cbe0cf3d7ebab6e20fe5f9a900ed487a7776de14..b01fdcfae1b9e106bee71bbc7554e69215e426cd 100644 (file)
@@ -2292,7 +2292,6 @@ GLIBC_2.32 __qecvtieee128_r F
 GLIBC_2.32 __qfcvtieee128 F
 GLIBC_2.32 __qfcvtieee128_r F
 GLIBC_2.32 __qgcvtieee128 F
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 __scanfieee128 F
 GLIBC_2.32 __snprintf_chkieee128 F
 GLIBC_2.32 __snprintfieee128 F
index b361308505e78edeb11f1fc30b6fde16b3c9957e..45cbeb1d98f376670f77a73d855fbb55d51bc89d 100644 (file)
@@ -2112,7 +2112,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
diff --git a/sysdeps/unix/sysv/linux/rseq-internal.h b/sysdeps/unix/sysv/linux/rseq-internal.h
deleted file mode 100644 (file)
index 8f6772c..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Restartable Sequences internal API.  Linux implementation.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef RSEQ_INTERNAL_H
-#define RSEQ_INTERNAL_H
-
-#include <sysdep.h>
-#include <errno.h>
-#include <kernel-features.h>
-#include <stdio.h>
-#include <sys/rseq.h>
-
-#ifdef RSEQ_SIG
-static inline void
-rseq_register_current_thread (void)
-{
-  int ret;
-
-  if (__rseq_abi.cpu_id != RSEQ_CPU_ID_UNINITIALIZED)
-    __libc_fatal ("glibc fatal error: "
-                  "rseq already initialized for this thread\n");
-  ret = INTERNAL_SYSCALL_CALL (rseq, &__rseq_abi, sizeof (struct rseq),
-                               0, RSEQ_SIG);
-  if (INTERNAL_SYSCALL_ERROR_P (ret))
-    {
-      const char *msg = NULL;
-
-      switch (INTERNAL_SYSCALL_ERRNO (ret))
-        {
-        case ENOSYS:    /* rseq system call not implemented.  */
-        case EPERM:     /* rseq system call filtered by seccomp.  */
-        case EACCES:    /* rseq system call filtered by seccomp.  */
-          __rseq_abi.cpu_id = RSEQ_CPU_ID_REGISTRATION_FAILED;
-          break;
-        case EBUSY:
-          msg = "glibc fatal error: rseq already registered for this thread\n";
-          break;
-        case EFAULT:
-          msg = "glibc fatal error: rseq parameter is an invalid address\n";
-          break;
-        case EINVAL:
-          msg = "glibc fatal error: rseq parameters are invalid\n";
-          break;
-        default:
-          msg = "glibc fatal error: unexpected rseq errno\n";
-          break;
-        }
-      if (msg != NULL)
-        __libc_fatal (msg);
-    }
-}
-#else /* RSEQ_SIG */
-static inline void
-rseq_register_current_thread (void)
-{
-}
-#endif /* RSEQ_SIG */
-
-#endif /* rseq-internal.h */
diff --git a/sysdeps/unix/sysv/linux/rseq-sym.c b/sysdeps/unix/sysv/linux/rseq-sym.c
deleted file mode 100644 (file)
index 0900934..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Restartable Sequences exported symbols.  Linux Implementation.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <sys/syscall.h>
-#include <stdint.h>
-#include <kernel-features.h>
-#include <sys/rseq.h>
-
-__thread struct rseq __rseq_abi =
-  {
-    .cpu_id = RSEQ_CPU_ID_UNINITIALIZED,
-  };
diff --git a/sysdeps/unix/sysv/linux/s390/bits/rseq.h b/sysdeps/unix/sysv/linux/s390/bits/rseq.h
deleted file mode 100644 (file)
index 3d6fd0c..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Restartable Sequences Linux s390 architecture header.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYS_RSEQ_H
-# error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
-#endif
-
-/* RSEQ_SIG is a signature required before each abort handler code.
-
-   It is a 32-bit value that maps to actual architecture code compiled
-   into applications and libraries.  It needs to be defined for each
-   architecture.  When choosing this value, it needs to be taken into
-   account that generating invalid instructions may have ill effects on
-   tools like objdump, and may also have impact on the CPU speculative
-   execution efficiency in some cases.
-
-   RSEQ_SIG uses the trap4 instruction.  As Linux does not make use of the
-   access-register mode nor the linkage stack this instruction will always
-   cause a special-operation exception (the trap-enabled bit in the DUCT
-   is and will stay 0).  The instruction pattern is
-       b2 ff 0f ff        trap4   4095(%r0)  */
-
-#define RSEQ_SIG        0xB2FF0FFF
index 37e313a1b014f488ba382f4baf74c47c0242cd57..d0752dba6c20786ea454b6bae104cc416c47cb49 100644 (file)
@@ -2190,7 +2190,6 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 5ff64d8a0a413b5be06bae51c67a6e6b3b1ac1cb..af5f14d1c6ab2c9f13b50f731b5fe4a48933185a 100644 (file)
@@ -2091,7 +2091,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index c0f992e05629c40eafe1ece5a8c04a8a4db7fd41..c019cfb3cfb74ae6a240707b63c1be23e4a99b03 100644 (file)
 #include <errno.h>
 #include <sched.h>
 #include <sysdep.h>
-#include <atomic.h>
 #include <sysdep-vdso.h>
-#include <sys/rseq.h>
 
-static int
-vsyscall_sched_getcpu (void)
+int
+sched_getcpu (void)
 {
   unsigned int cpu;
   int r = -1;
@@ -34,19 +32,3 @@ vsyscall_sched_getcpu (void)
 #endif
   return r == -1 ? r : cpu;
 }
-
-#ifdef RSEQ_SIG
-int
-sched_getcpu (void)
-{
-  int cpu_id = atomic_load_relaxed (&__rseq_abi.cpu_id);
-
-  return cpu_id >= 0 ? cpu_id : vsyscall_sched_getcpu ();
-}
-#else /* RSEQ_SIG */
-int
-sched_getcpu (void)
-{
-  return vsyscall_sched_getcpu ();
-}
-#endif /* RSEQ_SIG */
index 7e65b3e317789d9273c39e849f656d4ca95ae048..038ce27174ca09ed5e5717a7aaca6ee8099cd324 100644 (file)
@@ -2060,7 +2060,6 @@ GLIBC_2.31 msgctl F
 GLIBC_2.31 semctl F
 GLIBC_2.31 shmctl F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 6a3eeed9213152b48d22e423ae9add6110f8c571..182970a7085e429b9049f4ac131e04a4aa34c4ed 100644 (file)
@@ -2057,7 +2057,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 196f7f2543ec7de2d60613206a264c32f6dbd0b1..a2521c3ee3f7694a3e91416f927032e93819114b 100644 (file)
@@ -2181,7 +2181,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 2ca03d70621bdb6325fa9802fe52c812d4d2a290..d8188903f922ce672be9d40df1fbca14fb5f54a2 100644 (file)
@@ -2108,7 +2108,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
diff --git a/sysdeps/unix/sysv/linux/sys/rseq.h b/sysdeps/unix/sysv/linux/sys/rseq.h
deleted file mode 100644 (file)
index 55090f9..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-/* Restartable Sequences exported symbols.  Linux header.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYS_RSEQ_H
-#define _SYS_RSEQ_H    1
-
-/* Architecture-specific rseq signature.  */
-#include <bits/rseq.h>
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-
-#ifdef __has_include
-# if __has_include ("linux/rseq.h")
-#  define __GLIBC_HAVE_KERNEL_RSEQ
-# endif
-#else
-# include <linux/version.h>
-# if LINUX_VERSION_CODE >= KERNEL_VERSION (4, 18, 0)
-#  define __GLIBC_HAVE_KERNEL_RSEQ
-# endif
-#endif
-
-/* Rely on GNU extensions for older standards and tls model.  */
-#ifdef __GNUC__
-# define __rseq_tls_model_ie __attribute__ ((__tls_model__ ("initial-exec")))
-#else
-/* Specifying the TLS model on the declaration is optional.  */
-# define __rseq_tls_model_ie /* Nothing.  */
-#endif
-
-#ifdef __cplusplus
-# if  __cplusplus >= 201103L
-#  define __rseq_tls_storage_class               thread_local
-# endif
-#elif (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) >= 201112L
-# define __rseq_tls_storage_class                _Thread_local
-#endif
-
-/* Fall back to __thread for TLS storage class.  */
-#ifndef __rseq_tls_storage_class
-# define __rseq_tls_storage_class __thread
-#endif
-
-#ifdef __GLIBC_HAVE_KERNEL_RSEQ
-/* We use the structures declarations from the kernel headers.  */
-# include <linux/rseq.h>
-#else /* __GLIBC_HAVE_KERNEL_RSEQ */
-/* We use a copy of the include/uapi/linux/rseq.h kernel header.  */
-
-# include <asm/byteorder.h>
-
-enum rseq_cpu_id_state
-  {
-    RSEQ_CPU_ID_UNINITIALIZED = -1,
-    RSEQ_CPU_ID_REGISTRATION_FAILED = -2,
-  };
-
-enum rseq_flags
-  {
-    RSEQ_FLAG_UNREGISTER = (1 << 0),
-  };
-
-enum rseq_cs_flags_bit
-  {
-    RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT = 0,
-    RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT = 1,
-    RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT = 2,
-  };
-
-enum rseq_cs_flags
-  {
-    RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT =
-      (1U << RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT),
-    RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL =
-      (1U << RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT),
-    RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE =
-      (1U << RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT),
-  };
-
-/* struct rseq_cs is aligned on 32 bytes to ensure it is always
-   contained within a single cache-line.  It is usually declared as
-   link-time constant data.  */
-struct rseq_cs
-  {
-    /* Version of this structure.  */
-    uint32_t version;
-    /* enum rseq_cs_flags.  */
-    uint32_t flags;
-    uint64_t start_ip;
-    /* Offset from start_ip.  */
-    uint64_t post_commit_offset;
-    uint64_t abort_ip;
-  } __attribute__ ((__aligned__ (32)));
-
-/* struct rseq is aligned on 32 bytes to ensure it is always
-   contained within a single cache-line.
-
-   A single struct rseq per thread is allowed.  */
-struct rseq
-  {
-    /* Restartable sequences cpu_id_start field.  Updated by the
-       kernel.  Read by user-space with single-copy atomicity
-       semantics.  This field should only be read by the thread which
-       registered this data structure.  Aligned on 32-bit.  Always
-       contains a value in the range of possible CPUs, although the
-       value may not be the actual current CPU (e.g. if rseq is not
-       initialized).  This CPU number value should always be compared
-       against the value of the cpu_id field before performing a rseq
-       commit or returning a value read from a data structure indexed
-       using the cpu_id_start value.  */
-    uint32_t cpu_id_start;
-    /* Restartable sequences cpu_id field.  Updated by the kernel.
-       Read by user-space with single-copy atomicity semantics.  This
-       field should only be read by the thread which registered this
-       data structure.  Aligned on 32-bit.  Values
-       RSEQ_CPU_ID_UNINITIALIZED and RSEQ_CPU_ID_REGISTRATION_FAILED
-       have a special semantic: the former means "rseq uninitialized",
-       and latter means "rseq initialization failed".  This value is
-       meant to be read within rseq critical sections and compared
-       with the cpu_id_start value previously read, before performing
-       the commit instruction, or read and compared with the
-       cpu_id_start value before returning a value loaded from a data
-       structure indexed using the cpu_id_start value.  */
-    uint32_t cpu_id;
-    /* Restartable sequences rseq_cs field.
-
-       Contains NULL when no critical section is active for the current
-       thread, or holds a pointer to the currently active struct rseq_cs.
-
-       Updated by user-space, which sets the address of the currently
-       active rseq_cs at the beginning of assembly instruction sequence
-       block, and set to NULL by the kernel when it restarts an assembly
-       instruction sequence block, as well as when the kernel detects that
-       it is preempting or delivering a signal outside of the range
-       targeted by the rseq_cs.  Also needs to be set to NULL by user-space
-       before reclaiming memory that contains the targeted struct rseq_cs.
-
-       Read and set by the kernel.  Set by user-space with single-copy
-       atomicity semantics.  This field should only be updated by the
-       thread which registered this data structure.  Aligned on 64-bit.  */
-    union
-      {
-        uint64_t ptr64;
-# ifdef __LP64__
-        uint64_t ptr;
-# else /* __LP64__ */
-        struct
-          {
-#  if (defined (__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || defined (__BIG_ENDIAN)
-            uint32_t padding; /* Initialized to zero.  */
-            uint32_t ptr32;
-#  else /* LITTLE */
-            uint32_t ptr32;
-            uint32_t padding; /* Initialized to zero.  */
-#  endif /* ENDIAN */
-          } ptr;
-# endif /* __LP64__ */
-      } rseq_cs;
-
-    /* Restartable sequences flags field.
-
-       This field should only be updated by the thread which
-       registered this data structure.  Read by the kernel.
-       Mainly used for single-stepping through rseq critical sections
-       with debuggers.
-
-       - RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT
-           Inhibit instruction sequence block restart on preemption
-           for this thread.
-       - RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL
-           Inhibit instruction sequence block restart on signal
-           delivery for this thread.
-       - RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE
-           Inhibit instruction sequence block restart on migration for
-           this thread.  */
-    uint32_t flags;
-  } __attribute__ ((__aligned__ (32)));
-
-#endif /* __GLIBC_HAVE_KERNEL_RSEQ */
-
-/* Allocations of struct rseq and struct rseq_cs on the heap need to
-   be aligned on 32 bytes.  Therefore, use of malloc is discouraged
-   because it does not guarantee alignment.  posix_memalign should be
-   used instead.  */
-
-extern __rseq_tls_storage_class struct rseq __rseq_abi __rseq_tls_model_ie;
-
-#endif /* sys/rseq.h */
diff --git a/sysdeps/unix/sysv/linux/tst-rseq-nptl.c b/sysdeps/unix/sysv/linux/tst-rseq-nptl.c
deleted file mode 100644 (file)
index 5e788dc..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-/* Restartable Sequences NPTL test.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-/* These tests validate that rseq is registered from various execution
-   contexts (main thread, destructor, other threads, other threads created
-   from destructor, forked process (without exec), pthread_atfork handlers,
-   pthread setspecific destructors, signal handlers, atexit handlers).
-
-   See the Linux kernel selftests for extensive rseq stress-tests.  */
-
-#include <stdio.h>
-#include <support/check.h>
-#include <support/xthread.h>
-#include <sys/rseq.h>
-#include <unistd.h>
-
-#ifdef RSEQ_SIG
-# include <array_length.h>
-# include <errno.h>
-# include <error.h>
-# include <pthread.h>
-# include <signal.h>
-# include <stdlib.h>
-# include <string.h>
-# include <support/namespace.h>
-# include <support/xsignal.h>
-# include <syscall.h>
-# include <sys/types.h>
-# include <sys/wait.h>
-# include "tst-rseq.h"
-
-static pthread_key_t rseq_test_key;
-
-static void
-atfork_prepare (void)
-{
-  if (!rseq_thread_registered ())
-    {
-      printf ("error: rseq not registered in pthread atfork prepare\n");
-      support_record_failure ();
-    }
-}
-
-static void
-atfork_parent (void)
-{
-  if (!rseq_thread_registered ())
-    {
-      printf ("error: rseq not registered in pthread atfork parent\n");
-      support_record_failure ();
-    }
-}
-
-static void
-atfork_child (void)
-{
-  if (!rseq_thread_registered ())
-    {
-      printf ("error: rseq not registered in pthread atfork child\n");
-      support_record_failure ();
-    }
-}
-
-static void
-rseq_key_destructor (void *arg)
-{
-  /* Cannot use deferred failure reporting after main returns.  */
-  if (!rseq_thread_registered ())
-    FAIL_EXIT1 ("rseq not registered in pthread key destructor");
-}
-
-static void
-atexit_handler (void)
-{
-  /* Cannot use deferred failure reporting after main returns.  */
-  if (!rseq_thread_registered ())
-    FAIL_EXIT1 ("rseq not registered in atexit handler");
-}
-
-static void
-do_rseq_main_test (void)
-{
-  TEST_COMPARE (atexit (atexit_handler), 0);
-  rseq_test_key = xpthread_key_create (rseq_key_destructor);
-  TEST_COMPARE (pthread_atfork (atfork_prepare, atfork_parent, atfork_child), 0);
-  xraise (SIGUSR1);
-  TEST_COMPARE (pthread_setspecific (rseq_test_key, (void *) 1l), 0);
-  TEST_VERIFY_EXIT (rseq_thread_registered ());
-}
-
-static void
-cancel_routine (void *arg)
-{
-  if (!rseq_thread_registered ())
-    {
-      printf ("error: rseq not registered in cancel routine\n");
-      support_record_failure ();
-    }
-}
-
-static pthread_barrier_t cancel_thread_barrier;
-static pthread_cond_t cancel_thread_cond = PTHREAD_COND_INITIALIZER;
-static pthread_mutex_t cancel_thread_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-static void
-test_cancel_thread (void)
-{
-  pthread_cleanup_push (cancel_routine, NULL);
-  (void) xpthread_barrier_wait (&cancel_thread_barrier);
-  /* Wait forever until cancellation.  */
-  xpthread_cond_wait (&cancel_thread_cond, &cancel_thread_mutex);
-  pthread_cleanup_pop (0);
-}
-
-static void *
-thread_function (void * arg)
-{
-  int i = (int) (intptr_t) arg;
-
-  xraise (SIGUSR1);
-  if (i == 0)
-    test_cancel_thread ();
-  TEST_COMPARE (pthread_setspecific (rseq_test_key, (void *) 1l), 0);
-  return rseq_thread_registered () ? NULL : (void *) 1l;
-}
-
-static void
-sighandler (int sig)
-{
-  if (!rseq_thread_registered ())
-    {
-      printf ("error: rseq not registered in signal handler\n");
-      support_record_failure ();
-    }
-}
-
-static void
-setup_signals (void)
-{
-  struct sigaction sa;
-
-  sigemptyset (&sa.sa_mask);
-  sigaddset (&sa.sa_mask, SIGUSR1);
-  sa.sa_flags = 0;
-  sa.sa_handler = sighandler;
-  xsigaction (SIGUSR1, &sa, NULL);
-}
-
-static int
-do_rseq_threads_test (int nr_threads)
-{
-  pthread_t th[nr_threads];
-  int i;
-  int result = 0;
-
-  xpthread_barrier_init (&cancel_thread_barrier, NULL, 2);
-
-  for (i = 0; i < nr_threads; ++i)
-    th[i] = xpthread_create (NULL, thread_function,
-                             (void *) (intptr_t) i);
-
-  (void) xpthread_barrier_wait (&cancel_thread_barrier);
-
-  xpthread_cancel (th[0]);
-
-  for (i = 0; i < nr_threads; ++i)
-    {
-      void *v;
-
-      v = xpthread_join (th[i]);
-      if (i != 0 && v != NULL)
-        {
-          printf ("error: join %d successful, but child failed\n", i);
-          result = 1;
-        }
-      else if (i == 0 && v == NULL)
-        {
-          printf ("error: join %d successful, child did not fail as expected\n", i);
-          result = 1;
-        }
-    }
-
-  xpthread_barrier_destroy (&cancel_thread_barrier);
-
-  return result;
-}
-
-static void
-subprocess_callback (void *closure)
-{
-  do_rseq_main_test ();
-}
-
-static void
-do_rseq_fork_test (void)
-{
-  support_isolate_in_subprocess (subprocess_callback, NULL);
-}
-
-static int
-do_rseq_test (void)
-{
-  int t[] = { 1, 2, 6, 5, 4, 3, 50 };
-  int i, result = 0;
-
-  if (!rseq_available ())
-    FAIL_UNSUPPORTED ("kernel does not support rseq, skipping test");
-  setup_signals ();
-  xraise (SIGUSR1);
-  do_rseq_main_test ();
-  for (i = 0; i < array_length (t); i++)
-    if (do_rseq_threads_test (t[i]))
-      result = 1;
-  do_rseq_fork_test ();
-  return result;
-}
-
-static void __attribute__ ((destructor))
-do_rseq_destructor_test (void)
-{
-  /* Cannot use deferred failure reporting after main returns.  */
-  if (do_rseq_test ())
-    FAIL_EXIT1 ("rseq not registered within destructor");
-  xpthread_key_delete (rseq_test_key);
-}
-
-#else /* RSEQ_SIG */
-static int
-do_rseq_test (void)
-{
-  FAIL_UNSUPPORTED ("glibc does not define RSEQ_SIG, skipping test");
-  return 0;
-}
-#endif /* RSEQ_SIG */
-
-static int
-do_test (void)
-{
-  return do_rseq_test ();
-}
-
-#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-rseq.c b/sysdeps/unix/sysv/linux/tst-rseq.c
deleted file mode 100644 (file)
index aa902fb..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Restartable Sequences single-threaded tests.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-/* These tests validate that rseq is registered from main in an executable
-   not linked against libpthread.  */
-
-#include <support/check.h>
-#include <stdio.h>
-#include <sys/rseq.h>
-#include <unistd.h>
-
-#ifdef RSEQ_SIG
-# include <errno.h>
-# include <error.h>
-# include <stdlib.h>
-# include <string.h>
-# include <syscall.h>
-# include "tst-rseq.h"
-
-static void
-do_rseq_main_test (void)
-{
-  TEST_VERIFY_EXIT (rseq_thread_registered ());
-}
-
-static void
-do_rseq_test (void)
-{
-  if (!rseq_available ())
-    {
-      FAIL_UNSUPPORTED ("kernel does not support rseq, skipping test");
-    }
-  do_rseq_main_test ();
-}
-#else /* RSEQ_SIG */
-static void
-do_rseq_test (void)
-{
-  FAIL_UNSUPPORTED ("glibc does not define RSEQ_SIG, skipping test");
-}
-#endif /* RSEQ_SIG */
-
-static int
-do_test (void)
-{
-  do_rseq_test ();
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/tst-rseq.h b/sysdeps/unix/sysv/linux/tst-rseq.h
deleted file mode 100644 (file)
index c2cb211..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Restartable Sequences tests header.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <error.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <support/check.h>
-#include <syscall.h>
-#include <sys/rseq.h>
-
-static inline bool
-rseq_thread_registered (void)
-{
-  int32_t v;
-
-  __atomic_load (&__rseq_abi.cpu_id, &v, __ATOMIC_RELAXED);
-  return v >= 0;
-}
-
-static inline int
-sys_rseq (struct rseq *rseq_abi, uint32_t rseq_len, int flags, uint32_t sig)
-{
-  return syscall (__NR_rseq, rseq_abi, rseq_len, flags, sig);
-}
-
-static inline bool
-rseq_available (void)
-{
-  int rc;
-
-  rc = sys_rseq (NULL, 0, 0, 0);
-  if (rc != -1)
-    FAIL_EXIT1 ("Unexpected rseq return value %d", rc);
-  switch (errno)
-    {
-    case ENOSYS:
-      return false;
-    case EINVAL:
-      /* rseq is implemented, but detected an invalid rseq_len parameter.  */
-      return true;
-    default:
-      FAIL_EXIT1 ("Unexpected rseq error %s", strerror (errno));
-    }
-}
diff --git a/sysdeps/unix/sysv/linux/x86/bits/rseq.h b/sysdeps/unix/sysv/linux/x86/bits/rseq.h
deleted file mode 100644 (file)
index f801d5d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Restartable Sequences Linux x86 architecture header.
-   Copyright (C) 2020 Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _SYS_RSEQ_H
-# error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
-#endif
-
-/* RSEQ_SIG is a signature required before each abort handler code.
-
-   RSEQ_SIG is used with the following reserved undefined instructions, which
-   trap in user-space:
-
-   x86-32:    0f b9 3d 53 30 05 53      ud1    0x53053053,%edi
-   x86-64:    0f b9 3d 53 30 05 53      ud1    0x53053053(%rip),%edi  */
-
-#define RSEQ_SIG        0x53053053
index 86a481be42052aa7c9b84f1398a5c0b308f7928c..1a96103c681809179bbd3ab4cca72d9de0170b4f 100644 (file)
@@ -2066,7 +2066,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F
index 056de03ae391b865766e6656c969854493a751d3..35745a75b6f4a9477d229217674a1c3de24f94d4 100644 (file)
@@ -2163,7 +2163,6 @@ GLIBC_2.30 gettid F
 GLIBC_2.30 tgkill F
 GLIBC_2.30 twalk_r F
 GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
 GLIBC_2.32 pthread_attr_getsigmask_np F
 GLIBC_2.32 pthread_attr_setaffinity_np F
 GLIBC_2.32 pthread_attr_setsigmask_np F