From patchwork Fri Jun 14 15:22:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1116067 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-102728-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="p8VmxUo5"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="cM3bES3k"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45QPWW1438z9sBr for ; Sat, 15 Jun 2019 01:23:18 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=TcrrCXF++b8mcKkgMWXVQdmByhaY/JQtOxCvC/Y0CLynyTuRwVGWs ZSl6rruwHapyOVIGfBL0eNDvc+hHPOqI82WktGU3R/nRmxnrT+HzqwducOqtlzv+ DCVcMBM5u3HkQuEzdgAc0ef1mDtVlK6ddbw6Ba2uFSGUSCI05tPDR8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=qRmjPSw8TkKIQO0tDAdGNBV5gzc=; b=p8VmxUo52rbCBhYLaBwCflX4amBI 9B3Jk3kc9CzFfefyqMs7avpVC5KyxGSJZBbG7IArjLa06nHyaKTMvOa5OqECfp64 DVT7sTPv0BmERFAPlGNzat4tXX7scoeTQqo0EMv1IEoGXzBkKWCOK2eS9T1MirFW Z+uGdBNNYc7ZFhw= Received: (qmail 101773 invoked by alias); 14 Jun 2019 15:23:12 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 101756 invoked by uid 89); 14 Jun 2019 15:23:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=csu, patchset X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 1EB9225171C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1560525788; bh=5E5aIrHgOUv7J5M2lhuwUvqNdZJdtwT7kEDYvQtIM6c=; h=From:To:Date:Message-Id; b=cM3bES3klU8NrGMgLJVKRVVSYwSJ+0NY3Xk9gftK0YVbRm422If++IgGtUIH0tqIm czfhqI2yNes70DIGYebS7i7RK5BFv5wiKDDyLJdDDHJEaqTqstpWLf7uf+VhCuyJvM iStcWDDcjpBYhAuRl0GG/lmd4Bj14TXdVbGOdritNlP0on858RT47H5G1L92u6se6L MQSzYoJcPuijjf2AIp1oXzbX5po0p/Dk0Bs+cw5X+g2dNRFIOXVLBhnL3Q94o7Envp 4rUA8zSGLNMLcc0kAVfsDvWTiafZXGmXQ2uvOh5SHwsCo2yWHcpnqSz+X9m1ZABZzE LB108fSogyKOA== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org, Mathieu Desnoyers Subject: [PATCH glibc 0/5] Restartable Sequences support for glibc Date: Fri, 14 Jun 2019 11:22:59 -0400 Message-Id: <20190614152304.12321-1-mathieu.desnoyers@efficios.com> Hi, This patchset implements basic support for the "rseq" Linux system call in glibc by registering the rseq TLS abi. One patch in this series modifies sched_getcpu() to speed up reading the current CPU number by reading __rseq_abi.cpu_id when rseq is available. It takes into account the last round of feedback that was received. Please consider for inclusion into glibc, Thanks, Mathieu Mathieu Desnoyers (5): glibc: Perform rseq(2) registration at C startup and thread creation (v11) glibc: sched_getcpu(): use rseq cpu_id TLS on Linux (v5) support record failure: allow use from constructor support: implement xpthread key create/delete (v2) rseq registration tests (v5) ChangeLog | 96 +++++ NEWS | 15 + csu/libc-start.c | 14 +- elf/dl-support.c | 22 ++ elf/rtld.c | 26 ++ misc/rseq-internal.h | 38 ++ nptl/pthread_create.c | 9 + support/Makefile | 2 + support/check.h | 4 + support/support_record_failure.c | 18 +- support/xpthread_key_create.c | 25 ++ support/xpthread_key_delete.c | 24 ++ support/xthread.h | 2 + sysdeps/unix/sysv/linux/Makefile | 8 +- sysdeps/unix/sysv/linux/Versions | 10 + sysdeps/unix/sysv/linux/aarch64/bits/rseq.h | 43 ++ sysdeps/unix/sysv/linux/aarch64/ld.abilist | 1 + sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 + sysdeps/unix/sysv/linux/alpha/ld.abilist | 1 + sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/ld.abilist | 1 + sysdeps/unix/sysv/linux/arm/libc.abilist | 1 + sysdeps/unix/sysv/linux/bits/rseq.h | 29 ++ sysdeps/unix/sysv/linux/csky/ld.abilist | 1 + sysdeps/unix/sysv/linux/csky/libc.abilist | 1 + sysdeps/unix/sysv/linux/hppa/ld.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + sysdeps/unix/sysv/linux/i386/ld.abilist | 1 + sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + sysdeps/unix/sysv/linux/ia64/ld.abilist | 1 + sysdeps/unix/sysv/linux/ia64/libc.abilist | 1 + .../unix/sysv/linux/m68k/coldfire/ld.abilist | 1 + .../sysv/linux/m68k/coldfire/libc.abilist | 1 + .../unix/sysv/linux/m68k/m680x0/ld.abilist | 1 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 1 + sysdeps/unix/sysv/linux/microblaze/ld.abilist | 1 + .../unix/sysv/linux/microblaze/libc.abilist | 1 + sysdeps/unix/sysv/linux/mips/bits/rseq.h | 62 +++ .../sysv/linux/mips/mips32/fpu/libc.abilist | 1 + .../unix/sysv/linux/mips/mips32/ld.abilist | 1 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 1 + .../sysv/linux/mips/mips64/n32/ld.abilist | 1 + .../sysv/linux/mips/mips64/n32/libc.abilist | 1 + .../sysv/linux/mips/mips64/n64/ld.abilist | 1 + .../sysv/linux/mips/mips64/n64/libc.abilist | 1 + sysdeps/unix/sysv/linux/nios2/ld.abilist | 1 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 1 + sysdeps/unix/sysv/linux/powerpc/bits/rseq.h | 37 ++ .../linux/powerpc/powerpc32/fpu/libc.abilist | 1 + .../sysv/linux/powerpc/powerpc32/ld.abilist | 1 + .../powerpc/powerpc32/nofpu/libc.abilist | 1 + .../linux/powerpc/powerpc64/be/ld.abilist | 1 + .../linux/powerpc/powerpc64/be/libc.abilist | 1 + .../linux/powerpc/powerpc64/le/ld.abilist | 1 + .../linux/powerpc/powerpc64/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/riscv/rv64/ld.abilist | 1 + .../unix/sysv/linux/riscv/rv64/libc.abilist | 1 + sysdeps/unix/sysv/linux/rseq-internal.h | 88 +++++ sysdeps/unix/sysv/linux/rseq-sym.c | 43 ++ sysdeps/unix/sysv/linux/s390/bits/rseq.h | 37 ++ .../unix/sysv/linux/s390/s390-32/ld.abilist | 1 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-64/ld.abilist | 1 + .../unix/sysv/linux/s390/s390-64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sched_getcpu.c | 25 +- sysdeps/unix/sysv/linux/sh/ld.abilist | 1 + sysdeps/unix/sysv/linux/sh/libc.abilist | 1 + .../unix/sysv/linux/sparc/sparc32/ld.abilist | 1 + .../sysv/linux/sparc/sparc32/libc.abilist | 1 + .../unix/sysv/linux/sparc/sparc64/ld.abilist | 1 + .../sysv/linux/sparc/sparc64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sys/rseq.h | 52 +++ sysdeps/unix/sysv/linux/tst-rseq-nptl.c | 368 ++++++++++++++++++ sysdeps/unix/sysv/linux/tst-rseq.c | 122 ++++++ sysdeps/unix/sysv/linux/x86/bits/rseq.h | 30 ++ sysdeps/unix/sysv/linux/x86_64/64/ld.abilist | 1 + .../unix/sysv/linux/x86_64/64/libc.abilist | 1 + sysdeps/unix/sysv/linux/x86_64/x32/ld.abilist | 1 + .../unix/sysv/linux/x86_64/x32/libc.abilist | 1 + 79 files changed, 1288 insertions(+), 13 deletions(-) create mode 100644 misc/rseq-internal.h create mode 100644 support/xpthread_key_create.c create mode 100644 support/xpthread_key_delete.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/mips/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/rseq-internal.h create mode 100644 sysdeps/unix/sysv/linux/rseq-sym.c create mode 100644 sysdeps/unix/sysv/linux/s390/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/sys/rseq.h create mode 100644 sysdeps/unix/sysv/linux/tst-rseq-nptl.c create mode 100644 sysdeps/unix/sysv/linux/tst-rseq.c create mode 100644 sysdeps/unix/sysv/linux/x86/bits/rseq.h