From patchwork Tue Feb 6 16:27:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Jeanson X-Patchwork-Id: 1895835 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=NA1cjCUL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4TTpc71mv9z23g2 for ; Wed, 7 Feb 2024 03:29:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E452385828B for ; Tue, 6 Feb 2024 16:29:25 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtpout.efficios.com (smtpout.efficios.com [IPv6:2607:5300:203:b2ee::31e5]) by sourceware.org (Postfix) with ESMTPS id 466723858C54 for ; Tue, 6 Feb 2024 16:28:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 466723858C54 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 466723858C54 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:5300:203:b2ee::31e5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707236895; cv=none; b=jicMpM9w+g7bP04LCxkZcWM9sYiPUnqTNrMi1BdhG23J19GOxDs+BO90L9ZSAUzbxhPrVFYRGig0NXYXPjEVflgfh1HKFdS413RdrvZLtW7ZcDIIPV5YTMrreiG7rwYE/aKLrSI/On/Zvm5HeOaoycUhSQfWBb5Wcd5DNtj8Muw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707236895; c=relaxed/simple; bh=XwMeuLTttFmNpH0O6/CQxuQMqN3yPK5AkOjfqtJan7g=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=gN1SXViO+ZvcstbWArJMoD1HA/O/dtxiwy6sWxgSqCG4osrZu4V8lu8cC0s6sB40dw1jdj/EyYC/5ez/G4fkBp57Q/v/SmHYagQO9x4RAM71SPVAWXfB3EA5zpOzqc9zHtdYhfR0BFCAG+NsmWoe95+LpPqrmz5R1pMWvTvEKFQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707236891; bh=XwMeuLTttFmNpH0O6/CQxuQMqN3yPK5AkOjfqtJan7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NA1cjCULQqx1VPILJkGYYCdcH7ZXH38318m3NR/tcuYyTmotkovj0DRkoCo/e++CI uqhd0uu9VrgtWlqpn1qnKu11AQO3M3bfdlX32J1aYrssGtF8iOP0ompk6f6uxpQImM 0cfzg2DgMM6BA7w1fMUbMeoiI1GoP0bsBY7B2HHRF4QWZxH/bCsF5umRxJ8/qcGPgE KxT2ryGOXzTChhPoDqE2eCMF0XZlzJBoOWoCFku7/2bm/NTZQtVXfpS7zNEB7J61nX HxBkJ2gFZyG7DG6TKRaPhjLrnf765T4dAAI7ZUeeD1mBapadhh806PPHbQ1lE+zOIh bYqKGyHukK2aw== 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 4TTpZg6V8vzXK5; Tue, 6 Feb 2024 11:28:11 -0500 (EST) From: Michael Jeanson To: libc-alpha@sourceware.org Cc: Michael Jeanson Subject: [PATCH v8 3/8] nptl: Add public __rseq_feature_size symbol Date: Tue, 6 Feb 2024 11:27:56 -0500 Message-Id: <20240206162801.882585-4-mjeanson@efficios.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206162801.882585-1-mjeanson@efficios.com> References: <20240206162801.882585-1-mjeanson@efficios.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 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, T_SCC_BODY_TEXT_LINE 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. Changes since v7: * Fix sorting of symbols in abilist files Signed-off-by: Michael Jeanson --- csu/rseq-sizes.sym | 3 +++ elf/dl-rseq-symbols.S | 17 +++++++++++++++++ manual/threads.texi | 8 ++++++++ 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, 71 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..2c9aaa9fb5 100644 --- a/manual/threads.texi +++ b/manual/threads.texi @@ -1011,6 +1011,14 @@ 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. If registration is successful, @code{__rseq_feature_size} +is at least 20 (the initial feature size of @code{struct rseq}). +@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 7aa15558e6..8f19c22a74 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 attribute_relro attribute_hidden; +extern unsigned int _rseq_feature_size attribute_relro attribute_hidden; extern ptrdiff_t _rseq_offset attribute_relro attribute_hidden; void @@ -108,6 +109,7 @@ __tls_init_tp (void) if (rseq_register_current_thread (pd, do_rseq)) { _rseq_size = GLRO (dl_tls_rseq_size); + _rseq_feature_size = GLRO (dl_tls_rseq_feature_size); } #ifdef RSEQ_SIG 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 ae4143916b..eb4b6278dc 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); TEST_COMPARE (sizeof (local_rseq), RSEQ_TEST_MIN_SIZE); 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