From patchwork Mon Mar 23 13:15:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: develop--- via Libc-alpha X-Patchwork-Id: 1260016 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=sourceware.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=yMPC9O3e; dkim-atps=neutral Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48mFL208myz9sSG for ; Tue, 24 Mar 2020 00:17:45 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 961953938806; Mon, 23 Mar 2020 13:17:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 961953938806 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1584969461; bh=e8FASxHk5HOYKKNd3FJptxeEc3rxpo8pqE5Ms5Uiqp4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=yMPC9O3e6hvCWHlclJaAZTYrgzFYYjcmeZDsrQxOl+iiKFNtcHz3OUzNUgrtQtFgV yIJm012UbGiKfghYH34+RUtaqiWTjPbS86jCIM90CXVasFk2tmcLMXCd4prDYKelh0 2KXN0pAkuP53XnvNCdb0cAkdAdKVf2+/D9zc8pmg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id EDC63389C426 for ; Mon, 23 Mar 2020 13:17:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EDC63389C426 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 5C69B1B7ABB; Mon, 23 Mar 2020 09:17:38 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nhX4RYzVUMVF; Mon, 23 Mar 2020 09:17:38 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id EA1891B7BB4; Mon, 23 Mar 2020 09:17:37 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com EA1891B7BB4 X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id B2gqDRmp29HB; Mon, 23 Mar 2020 09:17:37 -0400 (EDT) Received: from localhost.localdomain (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by mail.efficios.com (Postfix) with ESMTPSA id AE4131B7D13; Mon, 23 Mar 2020 09:17:37 -0400 (EDT) To: Carlos O'Donell Subject: [RFC PATCH glibc 0/8] Restartable Sequences enablement Date: Mon, 23 Mar 2020 09:15:59 -0400 Message-Id: <20200323131607.15185-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-16.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_3, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mathieu Desnoyers via Libc-alpha From: develop--- via Libc-alpha Reply-To: Mathieu Desnoyers Cc: libc-alpha@sourceware.org, Joseph Myers , Mathieu Desnoyers Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Hi, Please find the rseq-enablement patchset for comments in this series. This patch series is based on glibc master branch at commit 1fabdb9908 x86: Remove ARCH_CET_LEGACY_BITMAP [BZ #25397] Since the last post: - A copy of linux/rseq.h (reformatted to glibc's coding style) is integrated into sys/rseq.h as a fallback when linux/rseq.h cannot be found in the UAPI headers. - This approach allows removing the __ASSUME_RSEQ macro. - Introduce a _Static_assert in sys/rseq.h to validate that the compiler meets the alignment requirements of the rseq UAPI, IOW that it does not ignore the aligned attribute for struct rseq and struct rseq_cs. - Document that posix_memalign should be used intead of malloc when allocating struct rseq and struct rseq_cs on the heap. Thanks for the feedback! Mathieu Florian Weimer (3): Introduce Implement __libc_early_init nptl: Start new threads with all signals blocked [BZ #25098] Mathieu Desnoyers (5): glibc: Perform rseq(2) registration at C startup and thread creation (v16) glibc: sched_getcpu(): use rseq cpu_id TLS on Linux (v7) support record failure: allow use from constructor support: implement xpthread key create/delete (v4) rseq registration tests (v9) NEWS | 10 + csu/init-first.c | 4 - csu/libc-start.c | 5 + elf/Makefile | 5 +- elf/Versions | 1 + elf/dl-call-libc-early-init.c | 41 +++ elf/dl-load.c | 9 + elf/dl-lookup-direct.c | 116 ++++++ elf/dl-lookup.c | 10 +- elf/dl-open.c | 24 ++ elf/elf_machine_sym_no_match.h | 34 ++ elf/libc-early-init.h | 35 ++ elf/libc_early_init.c | 30 ++ elf/rtld.c | 4 + manual/threads.texi | 30 +- misc/rseq-internal.h | 33 ++ nptl/descr.h | 10 +- nptl/pthread_create.c | 56 ++- 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/generic/ldsodefs.h | 17 + sysdeps/mach/hurd/i386/init-first.c | 4 - sysdeps/mips/dl-machine.h | 15 - sysdeps/mips/elf_machine_sym_no_match.h | 43 +++ sysdeps/unix/sysv/linux/Makefile | 11 +- sysdeps/unix/sysv/linux/Versions | 3 + sysdeps/unix/sysv/linux/aarch64/bits/rseq.h | 43 +++ sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 + sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/bits/rseq.h | 83 +++++ sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/bits/rseq.h | 29 ++ sysdeps/unix/sysv/linux/csky/libc.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + sysdeps/unix/sysv/linux/ia64/libc.abilist | 1 + .../sysv/linux/m68k/coldfire/libc.abilist | 1 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 1 + .../sysv/linux/microblaze/be/libc.abilist | 1 + .../sysv/linux/microblaze/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/mips/bits/rseq.h | 62 ++++ .../sysv/linux/mips/mips32/fpu/libc.abilist | 1 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 1 + .../sysv/linux/mips/mips64/n32/libc.abilist | 1 + .../sysv/linux/mips/mips64/n64/libc.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 + .../powerpc/powerpc32/nofpu/libc.abilist | 1 + .../linux/powerpc/powerpc64/be/libc.abilist | 1 + .../linux/powerpc/powerpc64/le/libc.abilist | 1 + .../unix/sysv/linux/riscv/rv64/libc.abilist | 1 + sysdeps/unix/sysv/linux/rseq-internal.h | 73 ++++ sysdeps/unix/sysv/linux/rseq-sym.c | 25 ++ sysdeps/unix/sysv/linux/s390/bits/rseq.h | 37 ++ .../unix/sysv/linux/s390/s390-32/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sched_getcpu.c | 27 +- sysdeps/unix/sysv/linux/sh/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 + .../sysv/linux/sparc/sparc32/libc.abilist | 1 + .../sysv/linux/sparc/sparc64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sys/rseq.h | 186 ++++++++++ sysdeps/unix/sysv/linux/tst-rseq-nptl.c | 347 ++++++++++++++++++ sysdeps/unix/sysv/linux/tst-rseq.c | 108 ++++++ sysdeps/unix/sysv/linux/x86/bits/rseq.h | 30 ++ .../unix/sysv/linux/x86_64/64/libc.abilist | 1 + .../unix/sysv/linux/x86_64/x32/libc.abilist | 1 + 73 files changed, 1673 insertions(+), 69 deletions(-) create mode 100644 elf/dl-call-libc-early-init.c create mode 100644 elf/dl-lookup-direct.c create mode 100644 elf/elf_machine_sym_no_match.h create mode 100644 elf/libc-early-init.h create mode 100644 elf/libc_early_init.c 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/mips/elf_machine_sym_no_match.h create mode 100644 sysdeps/unix/sysv/linux/aarch64/bits/rseq.h create mode 100644 sysdeps/unix/sysv/linux/arm/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