From patchwork Mon Mar 25 18:29:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Jeanson X-Patchwork-Id: 1915803 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.a=rsa-sha256 header.s=smtpout1 header.b=gB6XLrkd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V3M2v2Mh8z1yY2 for ; Tue, 26 Mar 2024 05:31:35 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5075F385841A for ; Mon, 25 Mar 2024 18:31:30 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by sourceware.org (Postfix) with ESMTPS id C892B3858D3C for ; Mon, 25 Mar 2024 18:29:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C892B3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C892B3858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=167.114.26.122 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711391390; cv=none; b=LE45qMGIopwJnYcw7PSNAHoiYZKrkBOPJ2h72G9LWgNsSNXBYY5BsJpQHM+f7sZ/nM6GKssQ1hVfGWAvzVJFJhVhQ+zNziilPPzAlNyqKmi5q6kRU3A993bnQoqXRoApJkoYjU+GH8mNWY2gbK5cXs5C8UYBdzaroIXnZvetbMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711391390; c=relaxed/simple; bh=iOKS+6mhntxUKRROd0gAgSIa1cVcHRfMlgRV44XhDyE=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Vq5Y73LKluLRI7Ql3UY4VVuzFUmXL+JSIR90sNh3oxX5OeseIIUBixID3NmMhix0bnvZPh/4qGEg9lS1bQ+0uI9tXcDLGXeNrY3I0O7d/vACNVOOfWb27a25Pbfr95Llt0hu92R31m9nxSP4FHhADbUo0Qg8iuFpZt9Uz6A5mJE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1711391385; bh=iOKS+6mhntxUKRROd0gAgSIa1cVcHRfMlgRV44XhDyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gB6XLrkdefHBuLHu5PbEjr+6J7gyqmAXq0AZ3d6EwrvLbBFk4x/Ud8K4V5n7WTL2f v2xsYMTedr/iTXWC38E6/YxZLVyrrqmKKBm8hjE8uFgtGZgYVS3YMnJJ2ZzYc94PHo uTsPy8p7U1jJQZ0yxdrKZvR5NWfNKX18EkMQnfcVJrAoXeCqyBrjt58pBPrznvdTi/ k1xjQugSzSVbUYGCCrIipn6EiPV0HZfs5M3rySR542snKw8Xa689byDWwFQkk3odZ+ ymZh8h58oHQayiEJTieyP8rP26w6TPxcaKBPkOjQfgvDhfiL95dMBsib5JJdlyg7nK fFCyPAg0hoagw== Received: from laptop-mjeanson.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4V3M0n2xtwzmsH; Mon, 25 Mar 2024 14:29:45 -0400 (EDT) From: Michael Jeanson To: libc-alpha@sourceware.org Cc: Michael Jeanson , Florian Weimer , Carlos O'Donell , DJ Delorie , Mathieu Desnoyers Subject: [PATCH v10 3/4] nptl: Add public __rseq_feature_size symbol Date: Mon, 25 Mar 2024 14:29:26 -0400 Message-Id: <20240325182927.914830-4-mjeanson@efficios.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240325182927.914830-1-mjeanson@efficios.com> References: <20240325182927.914830-1-mjeanson@efficios.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Exposing this symbol allows applications wishing to use rseq features which are part of the extensible rseq ABI like 'node_id' and 'mm_cid' to test the two following conditions in a single load / conditional branch: - rseq is registered - the specific rseq feature is available This is useful as rseq is expected to be used in hot paths. This variable is either zero (if restartable sequence registration failed or has been disabled) or the size of the available restartable sequence features. Signed-off-by: Michael Jeanson --- Changes since v7: - Fix sorting of symbols in abilist files Changes since v8: - Remove superfluous attributes on externs - Clarify where the magic '20' initial feature size comes from --- csu/rseq-sizes.sym | 3 +++ elf/dl-rseq-symbols.S | 17 +++++++++++++++++ manual/threads.texi | 9 +++++++++ sysdeps/nptl/dl-tls_init_tp.c | 2 ++ sysdeps/unix/sysv/linux/Versions | 3 +++ sysdeps/unix/sysv/linux/aarch64/ld.abilist | 1 + sysdeps/unix/sysv/linux/alpha/ld.abilist | 1 + sysdeps/unix/sysv/linux/arc/ld.abilist | 1 + sysdeps/unix/sysv/linux/arm/be/ld.abilist | 1 + sysdeps/unix/sysv/linux/arm/le/ld.abilist | 1 + sysdeps/unix/sysv/linux/csky/ld.abilist | 1 + sysdeps/unix/sysv/linux/hppa/ld.abilist | 1 + sysdeps/unix/sysv/linux/i386/ld.abilist | 1 + .../unix/sysv/linux/loongarch/lp64/ld.abilist | 1 + .../unix/sysv/linux/m68k/coldfire/ld.abilist | 1 + sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist | 1 + sysdeps/unix/sysv/linux/microblaze/ld.abilist | 1 + sysdeps/unix/sysv/linux/mips/mips32/ld.abilist | 1 + .../unix/sysv/linux/mips/mips64/n32/ld.abilist | 1 + .../unix/sysv/linux/mips/mips64/n64/ld.abilist | 1 + sysdeps/unix/sysv/linux/nios2/ld.abilist | 1 + sysdeps/unix/sysv/linux/or1k/ld.abilist | 1 + .../sysv/linux/powerpc/powerpc32/ld.abilist | 1 + .../sysv/linux/powerpc/powerpc64/be/ld.abilist | 1 + .../sysv/linux/powerpc/powerpc64/le/ld.abilist | 1 + sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist | 1 + sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist | 1 + sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist | 1 + sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist | 1 + sysdeps/unix/sysv/linux/sh/be/ld.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/ld.abilist | 1 + .../unix/sysv/linux/sparc/sparc32/ld.abilist | 1 + .../unix/sysv/linux/sparc/sparc64/ld.abilist | 1 + sysdeps/unix/sysv/linux/sys/rseq.h | 4 ++++ sysdeps/unix/sysv/linux/tst-rseq-disable.c | 1 + sysdeps/unix/sysv/linux/tst-rseq.c | 4 +++- sysdeps/unix/sysv/linux/x86_64/64/ld.abilist | 1 + sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist | 1 + 38 files changed, 72 insertions(+), 1 deletion(-) diff --git a/csu/rseq-sizes.sym b/csu/rseq-sizes.sym index c959758ff0..dde53bfa60 100644 --- a/csu/rseq-sizes.sym +++ b/csu/rseq-sizes.sym @@ -4,5 +4,8 @@ RSEQ_SIZE_SIZE sizeof (unsigned int) RSEQ_SIZE_ALIGN __alignof (unsigned int) +RSEQ_FEATURE_SIZE_SIZE sizeof (unsigned int) +RSEQ_FEATURE_SIZE_ALIGN __alignof (unsigned int) + RSEQ_OFFSET_SIZE sizeof (ptrdiff_t) RSEQ_OFFSET_ALIGN __alignof (ptrdiff_t) diff --git a/elf/dl-rseq-symbols.S b/elf/dl-rseq-symbols.S index 2d8e88367f..709188ae22 100644 --- a/elf/dl-rseq-symbols.S +++ b/elf/dl-rseq-symbols.S @@ -38,6 +38,23 @@ __rseq_size: _rseq_size: .zero RSEQ_SIZE_SIZE +/* Define 2 symbols, __rseq_feature_size is public const and + _rseq_feature_size, which is an alias of __rseq_feature_size, but hidden and + writable for internal use. */ + + .globl __rseq_feature_size + .type __rseq_feature_size, %object + .size __rseq_feature_size, RSEQ_FEATURE_SIZE_SIZE + .hidden _rseq_feature_size + .globl _rseq_feature_size + .type _rseq_feature_size, %object + .size _rseq_feature_size, RSEQ_FEATURE_SIZE_SIZE + .section .data.rel.ro + .balign RSEQ_FEATURE_SIZE_ALIGN +__rseq_feature_size: +_rseq_feature_size: + .zero RSEQ_FEATURE_SIZE_SIZE + /* Define 2 symbols, __rseq_offset is public const and _rseq_offset, which is an alias of __rseq_offset, but hidden and writable for internal use. */ diff --git a/manual/threads.texi b/manual/threads.texi index e5544ff3da..186982246d 100644 --- a/manual/threads.texi +++ b/manual/threads.texi @@ -1011,6 +1011,15 @@ registration is successful, @code{__rseq_size} is at least 32 (the initial size of @code{struct rseq}). @end deftypevar +@deftypevar {unsigned int} __rseq_feature_size +@standards{Linux, sys/rseq.h} +This variable is either zero (if restartable sequence registration +failed or has been disabled) or the size of the restartable sequence +features supported by the running kernel. If registration is +successful, @code{__rseq_feature_size} is at least 20 (the feature size +of @code{struct rseq} in the initial rseq kernel implementation). +@end deftypevar + @deftypevar {unsigned int} __rseq_flags @standards{Linux, sys/rseq.h} The flags used during restartable sequence registration with the kernel. diff --git a/sysdeps/nptl/dl-tls_init_tp.c b/sysdeps/nptl/dl-tls_init_tp.c index 1cfaf38cf8..2e94268a96 100644 --- a/sysdeps/nptl/dl-tls_init_tp.c +++ b/sysdeps/nptl/dl-tls_init_tp.c @@ -48,6 +48,7 @@ const unsigned int __rseq_flags; /* The variables are in .data.relro but are not yet write-protected. */ extern unsigned int _rseq_size; +extern unsigned int _rseq_feature_size; extern ptrdiff_t _rseq_offset; void @@ -108,6 +109,7 @@ __tls_init_tp (void) if (rseq_register_current_thread (pd, do_rseq)) { _rseq_size = GLRO (dl_tls_rseq_alloc_size); + _rseq_feature_size = GLRO (dl_tls_rseq_feature_size); } /* If the registration fails or is disabled by tunable, the public rseq diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 268ba1b6ac..055be26dde 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -356,6 +356,9 @@ ld { __rseq_offset; __rseq_size; } + GLIBC_2.40 { + __rseq_feature_size; + } GLIBC_PRIVATE { __nptl_change_stack_perm; } diff --git a/sysdeps/unix/sysv/linux/aarch64/ld.abilist b/sysdeps/unix/sysv/linux/aarch64/ld.abilist index 5151c0781d..93039b756d 100644 --- a/sysdeps/unix/sysv/linux/aarch64/ld.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x8 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/alpha/ld.abilist b/sysdeps/unix/sysv/linux/alpha/ld.abilist index 3e296c5473..fc67e31293 100644 --- a/sysdeps/unix/sysv/linux/alpha/ld.abilist +++ b/sysdeps/unix/sysv/linux/alpha/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x8 GLIBC_2.35 __rseq_size D 0x4 GLIBC_2.4 __stack_chk_guard D 0x8 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/arc/ld.abilist b/sysdeps/unix/sysv/linux/arc/ld.abilist index 55f0c2ab9c..31156b6ee1 100644 --- a/sysdeps/unix/sysv/linux/arc/ld.abilist +++ b/sysdeps/unix/sysv/linux/arc/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/arm/be/ld.abilist b/sysdeps/unix/sysv/linux/arm/be/ld.abilist index f1da2c636d..3d16fa60db 100644 --- a/sysdeps/unix/sysv/linux/arm/be/ld.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.4 __stack_chk_guard D 0x4 GLIBC_2.4 __tls_get_addr F GLIBC_2.4 _dl_mcount F GLIBC_2.4 _r_debug D 0x14 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/arm/le/ld.abilist b/sysdeps/unix/sysv/linux/arm/le/ld.abilist index f1da2c636d..3d16fa60db 100644 --- a/sysdeps/unix/sysv/linux/arm/le/ld.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.4 __stack_chk_guard D 0x4 GLIBC_2.4 __tls_get_addr F GLIBC_2.4 _dl_mcount F GLIBC_2.4 _r_debug D 0x14 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/csky/ld.abilist b/sysdeps/unix/sysv/linux/csky/ld.abilist index 7f482276ed..088f000c4e 100644 --- a/sysdeps/unix/sysv/linux/csky/ld.abilist +++ b/sysdeps/unix/sysv/linux/csky/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/hppa/ld.abilist b/sysdeps/unix/sysv/linux/hppa/ld.abilist index 7f5527fb30..8ae26c46c1 100644 --- a/sysdeps/unix/sysv/linux/hppa/ld.abilist +++ b/sysdeps/unix/sysv/linux/hppa/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 GLIBC_2.4 __stack_chk_guard D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/i386/ld.abilist b/sysdeps/unix/sysv/linux/i386/ld.abilist index 9c4a45d8dc..d9761c34e3 100644 --- a/sysdeps/unix/sysv/linux/i386/ld.abilist +++ b/sysdeps/unix/sysv/linux/i386/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/ld.abilist b/sysdeps/unix/sysv/linux/loongarch/lp64/ld.abilist index 93fcd64eee..f5dbb17ec9 100644 --- a/sysdeps/unix/sysv/linux/loongarch/lp64/ld.abilist +++ b/sysdeps/unix/sysv/linux/loongarch/lp64/ld.abilist @@ -6,3 +6,4 @@ GLIBC_2.36 __stack_chk_guard D 0x8 GLIBC_2.36 __tls_get_addr F GLIBC_2.36 _dl_mcount F GLIBC_2.36 _r_debug D 0x28 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist index f1da2c636d..3d16fa60db 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.4 __stack_chk_guard D 0x4 GLIBC_2.4 __tls_get_addr F GLIBC_2.4 _dl_mcount F GLIBC_2.4 _r_debug D 0x14 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist index dadbf852d0..3888e39812 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 GLIBC_2.4 __stack_chk_guard D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/microblaze/ld.abilist b/sysdeps/unix/sysv/linux/microblaze/ld.abilist index 89a0b7e4fd..c83b62dce7 100644 --- a/sysdeps/unix/sysv/linux/microblaze/ld.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist index e304d1bb46..9710fdb941 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 GLIBC_2.4 __stack_chk_guard D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist index e304d1bb46..9710fdb941 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 GLIBC_2.4 __stack_chk_guard D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist index f26e594a13..ec1bdfd965 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x8 GLIBC_2.35 __rseq_size D 0x4 GLIBC_2.4 __stack_chk_guard D 0x8 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/nios2/ld.abilist b/sysdeps/unix/sysv/linux/nios2/ld.abilist index 811ae9da2f..d2b742ec25 100644 --- a/sysdeps/unix/sysv/linux/nios2/ld.abilist +++ b/sysdeps/unix/sysv/linux/nios2/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/or1k/ld.abilist b/sysdeps/unix/sysv/linux/or1k/ld.abilist index cff2ffd23b..eb225ca4c5 100644 --- a/sysdeps/unix/sysv/linux/or1k/ld.abilist +++ b/sysdeps/unix/sysv/linux/or1k/ld.abilist @@ -6,3 +6,4 @@ GLIBC_2.35 __stack_chk_guard D 0x4 GLIBC_2.35 __tls_get_addr F GLIBC_2.35 _dl_mcount F GLIBC_2.35 _r_debug D 0x14 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist index b1073f0942..7a94751723 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist @@ -9,3 +9,4 @@ GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 GLIBC_2.39 __parse_hwcap_3_4_and_convert_at_platform F +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist index 40942a2cc6..f6bdd89083 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/ld.abilist @@ -9,3 +9,4 @@ GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x8 GLIBC_2.35 __rseq_size D 0x4 GLIBC_2.39 __parse_hwcap_3_4_and_convert_at_platform F +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist index 01f2694a4d..672bade9ba 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/ld.abilist @@ -9,3 +9,4 @@ GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x8 GLIBC_2.35 __rseq_size D 0x4 GLIBC_2.39 __parse_hwcap_3_4_and_convert_at_platform F +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist index 068368878e..d3be9236c2 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist index a7758a0e52..46b22238ce 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x8 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist index c15288394a..f438808c08 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/ld.abilist @@ -6,3 +6,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist index 78d071600b..f5fbc6de43 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/ld.abilist @@ -6,3 +6,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x8 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/sh/be/ld.abilist b/sysdeps/unix/sysv/linux/sh/be/ld.abilist index 7f5527fb30..8ae26c46c1 100644 --- a/sysdeps/unix/sysv/linux/sh/be/ld.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 GLIBC_2.4 __stack_chk_guard D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/sh/le/ld.abilist b/sysdeps/unix/sysv/linux/sh/le/ld.abilist index 7f5527fb30..8ae26c46c1 100644 --- a/sysdeps/unix/sysv/linux/sh/le/ld.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/ld.abilist @@ -7,3 +7,4 @@ GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 GLIBC_2.4 __stack_chk_guard D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist index 3aac73f3df..df3f7fefb3 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/ld.abilist @@ -6,3 +6,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist index 5471b24d59..3bf61e1210 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ld.abilist @@ -6,3 +6,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x8 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/sys/rseq.h b/sysdeps/unix/sysv/linux/sys/rseq.h index b8afab8945..a048ba8958 100644 --- a/sysdeps/unix/sysv/linux/sys/rseq.h +++ b/sysdeps/unix/sysv/linux/sys/rseq.h @@ -163,6 +163,10 @@ extern const ptrdiff_t __rseq_offset; unsuccessful. */ extern const unsigned int __rseq_size; +/* Size of the registered rseq features. 0 if the registration was + unsuccessful. */ +extern const unsigned int __rseq_feature_size; + /* Flags used during rseq registration. */ extern const unsigned int __rseq_flags; diff --git a/sysdeps/unix/sysv/linux/tst-rseq-disable.c b/sysdeps/unix/sysv/linux/tst-rseq-disable.c index cd28f1ccfd..a3ea924daf 100644 --- a/sysdeps/unix/sysv/linux/tst-rseq-disable.c +++ b/sysdeps/unix/sysv/linux/tst-rseq-disable.c @@ -39,6 +39,7 @@ check_rseq_disabled (void) TEST_COMPARE (__rseq_flags, 0); TEST_COMPARE (__rseq_size, 0); + TEST_COMPARE (__rseq_feature_size, 0); TEST_COMPARE ((int) rseq_area->cpu_id, RSEQ_CPU_ID_REGISTRATION_FAILED); int ret = syscall (__NR_rseq, &local_rseq, RSEQ_TEST_MIN_SIZE, 0, RSEQ_SIG); diff --git a/sysdeps/unix/sysv/linux/tst-rseq.c b/sysdeps/unix/sysv/linux/tst-rseq.c index c8c0518a5d..c5d9afbb0a 100644 --- a/sysdeps/unix/sysv/linux/tst-rseq.c +++ b/sysdeps/unix/sysv/linux/tst-rseq.c @@ -38,12 +38,14 @@ static void do_rseq_main_test (void) { size_t rseq_align = MAX (getauxval (AT_RSEQ_ALIGN), RSEQ_TEST_MIN_ALIGN); - size_t rseq_size = roundup (MAX (getauxval (AT_RSEQ_FEATURE_SIZE), RSEQ_TEST_MIN_SIZE), rseq_align); + size_t rseq_feature_size = MAX (getauxval (AT_RSEQ_FEATURE_SIZE), RSEQ_TEST_MIN_FEATURE_SIZE); + size_t rseq_size = roundup (MAX (rseq_feature_size, RSEQ_TEST_MIN_SIZE), rseq_align); struct rseq *rseq = __thread_pointer () + __rseq_offset; TEST_VERIFY_EXIT (rseq_thread_registered ()); TEST_COMPARE (__rseq_flags, 0); TEST_COMPARE (__rseq_size, rseq_size); + TEST_COMPARE (__rseq_feature_size, rseq_feature_size); /* The size of the rseq area must be a multiple of the alignment. */ TEST_VERIFY ((__rseq_size % rseq_align) == 0); /* The rseq area address must be aligned. */ diff --git a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist index 5a8bd322cd..25c2153c21 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/ld.abilist @@ -6,3 +6,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x8 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4 diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist index e17496d124..05327004e2 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist @@ -6,3 +6,4 @@ GLIBC_2.34 __rtld_version_placeholder F GLIBC_2.35 __rseq_flags D 0x4 GLIBC_2.35 __rseq_offset D 0x4 GLIBC_2.35 __rseq_size D 0x4 +GLIBC_2.40 __rseq_feature_size D 0x4