unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: [PATCH v2 00/21] nptl: Fix Race conditions in pthread cancellation (BZ#12683)
Date: Mon, 26 Feb 2018 18:03:15 -0300	[thread overview]
Message-ID: <1519679016-12241-1-git-send-email-adhemerval.zanella@linaro.org> (raw)

Changes from previous version [1]:

  * Rebase againt master to incorporate the pthread_join consolidation.

  * Remove ARM syscall_cancel.S implementation and make it use default
    one instead.

  * Move the powerpc syscall stackframe to its own patch.

  * Added a RISCV port using generic syscall_cancel implementation.

I currently tested on x86_64-linux-gnu, x86_64-linux-gnu-x32, i686-linux-gnu,
arm-linux-gnueabihf, aarch64-linux-gnu, sparcv9-linux-gnu, sparc64-linux-gnu,
alpha-linux-gnu, and hppa-linux-gnu.  I also did some simple tests on
ia64-linux-gnu and mips{64}-linux-gnu (to check for the correctness in the
syscall wrapper implementation).  For the rest of support architectures
I just did a cross build/check.

[1] https://sourceware.org/ml/libc-alpha/2017-12/msg00314.html

Adhemerval Zanella (21):
  powerpc: Create stackframe information on syscall
  nptl: Fix testcases for new pthread cancellation mechanism
  nptl: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: x86_64: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: x32: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: i386: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: powerpc: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: aarch64: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: arm: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: s390: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: ia64: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: alpha: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: m68k: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: microblaze: Fix Race conditions in pthread cancellation
    (BZ#12683)
  nptl: tile: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: sparc: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: nios2: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: sh: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: mips: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: hppa: Fix Race conditions in pthread cancellation (BZ#12683)
  nptl: riscv: Fix Race conditions in pthread cancellation (BZ#12683)

 ChangeLog                                          | 216 +++++++++++++++++++++
 debug/tst-backtrace5.c                             |  28 +--
 include/libc-pointer-arith.h                       |  16 +-
 io/creat.c                                         |   3 -
 io/ppoll.c                                         |   2 -
 manual/llio.texi                                   |   4 +-
 misc/pselect.c                                     |   2 -
 nptl/Makefile                                      |  25 +--
 nptl/Versions                                      |   3 +
 nptl/cancellation.c                                | 101 ----------
 nptl/descr.h                                       |  15 +-
 nptl/libc-cancellation.c                           |  48 ++++-
 nptl/lll_timedlock_wait.c                          |   2 +-
 nptl/lll_timedwait_tid.c                           |   3 +-
 nptl/nptl-init.c                                   |  78 +++++---
 nptl/pthreadP.h                                    |  74 +++----
 nptl/pthread_cancel.c                              |  68 ++-----
 nptl/pthread_create.c                              |   7 +-
 nptl/pthread_exit.c                                |   9 +-
 nptl/pthread_join_common.c                         |   7 +-
 nptl/sem_wait.c                                    |   8 +-
 nptl/tst-cancel-wrappers.sh                        |  92 ---------
 nptl/tst-cancel2.c                                 |   3 -
 nptl/tst-cancel28.c                                |  94 +++++++++
 nptl/tst-cancel3.c                                 |   3 -
 nptl/tst-cancel4.c                                 |   8 +
 rt/Makefile                                        |   1 -
 support/temp_file.c                                |  23 +++
 support/temp_file.h                                |   6 +
 sysdeps/generic/sigcontextinfo.h                   |  15 ++
 sysdeps/generic/sysdep-cancel.h                    |   3 -
 sysdeps/i386/nptl/tls.h                            |  11 --
 sysdeps/mips/nptl/tls.h                            |   2 +-
 sysdeps/nptl/Makefile                              |   3 +-
 sysdeps/nptl/aio_misc.h                            |  13 +-
 sysdeps/nptl/gai_misc.h                            |  13 +-
 sysdeps/nptl/lowlevellock.h                        |   5 +-
 sysdeps/posix/open64.c                             |  12 +-
 sysdeps/posix/pause.c                              |   2 -
 sysdeps/posix/sigpause.c                           |   3 -
 sysdeps/posix/sigwait.c                            |   9 +-
 sysdeps/posix/waitid.c                             |  11 +-
 sysdeps/sh/sysdep.h                                |   1 +
 sysdeps/sparc/sparc32/lowlevellock.c               |   3 +-
 sysdeps/unix/sysdep.h                              | 118 +++++++++--
 sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h   |  11 ++
 sysdeps/unix/sysv/linux/alpha/sigcontextinfo.h     |  13 ++
 sysdeps/unix/sysv/linux/arm/Makefile               |   3 +
 sysdeps/unix/sysv/linux/arm/sigcontextinfo.h       |  12 ++
 sysdeps/unix/sysv/linux/clock_nanosleep.c          |  20 +-
 sysdeps/unix/sysv/linux/creat.c                    |   2 -
 sysdeps/unix/sysv/linux/creat64.c                  |   2 -
 sysdeps/unix/sysv/linux/futex-internal.h           |  18 +-
 .../sysv/linux/hppa/sigcontextinfo.h}              |  26 ++-
 sysdeps/unix/sysv/linux/hppa/syscall_cancel.S      |  82 ++++++++
 sysdeps/unix/sysv/linux/i386/Makefile              |   2 +-
 sysdeps/unix/sysv/linux/i386/lowlevellock.h        |   2 +-
 sysdeps/unix/sysv/linux/i386/sigcontextinfo.h      |  13 ++
 sysdeps/unix/sysv/linux/i386/syscall_cancel.S      | 107 ++++++++++
 sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h      |  24 +++
 sysdeps/unix/sysv/linux/ia64/syscall_cancel.S      |  94 +++++++++
 sysdeps/unix/sysv/linux/lowlevellock-futex.h       |  34 +++-
 sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h      |  13 ++
 .../unix/sysv/linux/microblaze/sigcontextinfo.h    |  13 ++
 .../unix/sysv/linux/microblaze/syscall_cancel.S    |  62 ++++++
 .../unix/sysv/linux/mips/mips32/syscall_cancel.S   | 128 ++++++++++++
 sysdeps/unix/sysv/linux/mips/mips32/sysdep.h       |   4 +
 sysdeps/unix/sysv/linux/mips/sigcontextinfo.h      |  13 +-
 sysdeps/unix/sysv/linux/nios2/sigcontextinfo.h     |  16 ++
 sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h   |  16 ++
 sysdeps/unix/sysv/linux/powerpc/syscall.S          |  14 ++
 sysdeps/unix/sysv/linux/powerpc/syscall_cancel.S   |  64 ++++++
 sysdeps/unix/sysv/linux/pthread_kill.c             |   5 +-
 sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h     |  12 ++
 sysdeps/unix/sysv/linux/s390/sigcontextinfo.h      |  17 ++
 sysdeps/unix/sysv/linux/sh/sigcontextinfo.h        |  11 ++
 sysdeps/unix/sysv/linux/sh/syscall_cancel.S        | 125 ++++++++++++
 sysdeps/unix/sysv/linux/sigwait.c                  |   3 -
 sysdeps/unix/sysv/linux/sigwaitinfo.c              |   3 -
 sysdeps/unix/sysv/linux/socketcall.h               |  37 +++-
 sysdeps/unix/sysv/linux/sparc/lowlevellock.h       |   2 +-
 .../unix/sysv/linux/sparc/sparc32/sigcontextinfo.h |  52 +++++
 .../unix/sysv/linux/sparc/sparc32/syscall_cancel.S |  74 +++++++
 .../libc-cancellation.S => sparc/sparc64/pause.c}  |  14 +-
 .../unix/sysv/linux/sparc/sparc64/sigcontextinfo.h |  40 ++++
 .../unix/sysv/linux/sparc/sparc64/syscall_cancel.S |  74 +++++++
 sysdeps/unix/sysv/linux/syscall_cancel.c           |  64 ++++++
 sysdeps/unix/sysv/linux/sysdep.h                   |  17 ++
 sysdeps/unix/sysv/linux/tile/sigcontextinfo.h      |  12 ++
 sysdeps/unix/sysv/linux/x86_64/cancellation.S      | 115 -----------
 .../unix/sysv/linux/x86_64/librt-cancellation.S    |  21 --
 sysdeps/unix/sysv/linux/x86_64/lowlevellock.h      |   8 +-
 sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h    |  11 ++
 sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h        |  13 ++
 sysdeps/x86_64/nptl/tcb-offsets.sym                |   1 -
 sysdeps/x86_64/nptl/tls.h                          |  11 --
 96 files changed, 2014 insertions(+), 709 deletions(-)
 delete mode 100644 nptl/cancellation.c
 delete mode 100644 nptl/tst-cancel-wrappers.sh
 create mode 100644 nptl/tst-cancel28.c
 rename sysdeps/{nptl/librt-cancellation.c => unix/sysv/linux/hppa/sigcontextinfo.h} (55%)
 create mode 100644 sysdeps/unix/sysv/linux/hppa/syscall_cancel.S
 create mode 100644 sysdeps/unix/sysv/linux/i386/syscall_cancel.S
 create mode 100644 sysdeps/unix/sysv/linux/ia64/syscall_cancel.S
 create mode 100644 sysdeps/unix/sysv/linux/microblaze/syscall_cancel.S
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips32/syscall_cancel.S
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/syscall_cancel.S
 create mode 100644 sysdeps/unix/sysv/linux/sh/syscall_cancel.S
 create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/syscall_cancel.S
 rename sysdeps/unix/sysv/linux/{x86_64/libc-cancellation.S => sparc/sparc64/pause.c} (66%)
 create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/syscall_cancel.S
 create mode 100644 sysdeps/unix/sysv/linux/syscall_cancel.c
 delete mode 100644 sysdeps/unix/sysv/linux/x86_64/cancellation.S
 delete mode 100644 sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S

-- 
2.7.4



             reply	other threads:[~2018-02-26 21:01 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 21:03 Adhemerval Zanella [this message]
2018-02-26 21:03 ` [PATCH v2 01/21] powerpc: Create stackframe information on syscall Adhemerval Zanella
2018-02-26 21:41   ` Andreas Schwab
2018-02-27 12:05     ` Adhemerval Zanella
2018-05-07  2:49   ` Zack Weinberg
2018-05-07 13:57     ` Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 02/21] nptl: Fix testcases for new pthread cancellation mechanism Adhemerval Zanella
2018-02-26 21:43   ` Andreas Schwab
2018-02-27 12:05     ` Adhemerval Zanella
2018-05-07  2:49   ` Zack Weinberg
2018-05-07 17:13     ` Adhemerval Zanella
2018-05-08 13:35       ` Zack Weinberg
2018-05-08 17:26         ` Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 03/21] nptl: Fix Race conditions in pthread cancellation (BZ#12683) Adhemerval Zanella
2018-04-27 12:20   ` Zack Weinberg
2018-04-27 12:25     ` Adhemerval Zanella
2018-05-07  2:48       ` Zack Weinberg
2018-05-07  2:49   ` Zack Weinberg
2018-05-08 17:11     ` Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 04/21] nptl: x86_64: " Adhemerval Zanella
2018-05-07  2:49   ` Zack Weinberg
2018-05-08 17:55     ` Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 05/21] nptl: x32: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 06/21] nptl: i386: " Adhemerval Zanella
2018-05-07  2:49   ` Zack Weinberg
2018-05-08 17:56     ` Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 07/21] nptl: powerpc: " Adhemerval Zanella
2018-05-07 19:25   ` Tulio Magno Quites Machado Filho
2018-05-08 18:07     ` Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 08/21] nptl: aarch64: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 09/21] nptl: arm: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 10/21] nptl: s390: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 11/21] nptl: ia64: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 12/21] nptl: alpha: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 13/21] nptl: m68k: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 14/21] nptl: microblaze: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 15/21] nptl: tile: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 16/21] nptl: sparc: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 17/21] nptl: nios2: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 18/21] nptl: sh: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 19/21] nptl: mips: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 20/21] nptl: hppa: " Adhemerval Zanella
2018-02-26 21:03 ` [PATCH v2 21/21] nptl: riscv: " Adhemerval Zanella
2018-02-27  1:16   ` DJ Delorie
2018-02-27 13:03     ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1519679016-12241-1-git-send-email-adhemerval.zanella@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).