public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: libc-stable@sourceware.org
Cc: fweimer@redhat.com, adhemerval.zanella@linaro.org
Subject: [Backport: 0/6] Update _dl_tlsdesc_dynamic to preserve caller-saved registers
Date: Mon,  1 Apr 2024 13:23:13 -0700	[thread overview]
Message-ID: <20240401202319.690253-1-hjl.tools@gmail.com> (raw)

GNU2 TLS descriptor instruction sequences have implicit _dl_tlsdesc_dynamic
call and compilers assume that caller-saved registers are unchanged after
call.  Update _dl_tlsdesc_dynamic to preserve caller-saved registers.

Adhemerval Zanella (3):
  Ignore undefined symbols for -mtls-dialect=gnu2
  arm: Update _dl_tlsdesc_dynamic to preserve caller-saved registers (BZ
    31372)
  elf: Enable TLS descriptor tests on aarch64

H.J. Lu (3):
  x86: Update _dl_tlsdesc_dynamic to preserve caller-saved registers
  x86-64: Update _dl_tlsdesc_dynamic to preserve AMX registers
  x86-64: Allocate state buffer space for RDI, RSI and RBX

 config.h.in                                   |   3 +
 configure                                     |  25 ++-
 configure.ac                                  |  17 +-
 elf/Makefile                                  |  34 +++-
 elf/tst-gnu2-tls2.c                           | 122 +++++++++++
 elf/tst-gnu2-tls2.h                           |  40 ++++
 elf/tst-gnu2-tls2mod0.c                       |  32 +++
 elf/tst-gnu2-tls2mod1.c                       |  32 +++
 elf/tst-gnu2-tls2mod2.c                       |  32 +++
 sysdeps/aarch64/preconfigure                  |   1 +
 sysdeps/arm/Makefile                          |   8 +-
 sysdeps/arm/configure                         |  32 +++
 sysdeps/arm/configure.ac                      |  15 ++
 sysdeps/arm/dl-tlsdesc.S                      |  70 ++++++-
 sysdeps/arm/tst-gnu2-tls2.h                   | 128 ++++++++++++
 sysdeps/i386/dl-machine.h                     |   2 +-
 sysdeps/i386/dl-tlsdesc-dynamic.h             | 190 ++++++++++++++++++
 sysdeps/i386/dl-tlsdesc.S                     | 115 +++++------
 sysdeps/unix/sysv/linux/x86_64/Makefile       |  27 +++
 .../sysv/linux/x86_64/include/asm/prctl.h     |   5 +
 .../linux/x86_64/tst-gnu2-tls2-amx-mod0.c     |   2 +
 .../linux/x86_64/tst-gnu2-tls2-amx-mod1.c     |   2 +
 .../linux/x86_64/tst-gnu2-tls2-amx-mod2.c     |   2 +
 .../sysv/linux/x86_64/tst-gnu2-tls2-amx.c     |  83 ++++++++
 .../sysv/linux/x86_64/tst-gnu2-tls2-amx.h     |  63 ++++++
 sysdeps/x86/Makefile                          |   7 +-
 sysdeps/x86/cpu-features-offsets.sym          |   1 +
 sysdeps/x86/cpu-features.c                    | 118 ++++++++++-
 sysdeps/x86/dl-procinfo.c                     |  16 ++
 sysdeps/{x86_64 => x86}/features-offsets.sym  |   2 +
 sysdeps/x86/include/cpu-features.h            |   2 +
 sysdeps/x86/sysdep.h                          |  78 ++++++-
 sysdeps/x86/tst-gnu2-tls2.c                   |  20 ++
 sysdeps/x86_64/Makefile                       |   2 +-
 sysdeps/x86_64/configure                      |  28 +++
 sysdeps/x86_64/configure.ac                   |  15 ++
 sysdeps/x86_64/dl-machine.h                   |  19 +-
 sysdeps/x86_64/dl-procinfo.c                  |  16 ++
 sysdeps/x86_64/dl-tlsdesc-dynamic.h           | 166 +++++++++++++++
 sysdeps/x86_64/dl-tlsdesc.S                   | 108 +++-------
 sysdeps/x86_64/dl-trampoline-save.h           |  34 ++++
 sysdeps/x86_64/dl-trampoline-state.h          |  51 +++++
 sysdeps/x86_64/dl-trampoline.S                |  20 +-
 sysdeps/x86_64/dl-trampoline.h                |  34 +---
 sysdeps/x86_64/tst-gnu2-tls2mod1.S            |  87 ++++++++
 45 files changed, 1642 insertions(+), 264 deletions(-)
 create mode 100644 elf/tst-gnu2-tls2.c
 create mode 100644 elf/tst-gnu2-tls2.h
 create mode 100644 elf/tst-gnu2-tls2mod0.c
 create mode 100644 elf/tst-gnu2-tls2mod1.c
 create mode 100644 elf/tst-gnu2-tls2mod2.c
 create mode 100644 sysdeps/arm/tst-gnu2-tls2.h
 create mode 100644 sysdeps/i386/dl-tlsdesc-dynamic.h
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx-mod0.c
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx-mod1.c
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx-mod2.c
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx.c
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/tst-gnu2-tls2-amx.h
 rename sysdeps/{x86_64 => x86}/features-offsets.sym (89%)
 create mode 100644 sysdeps/x86/tst-gnu2-tls2.c
 create mode 100644 sysdeps/x86_64/dl-tlsdesc-dynamic.h
 create mode 100644 sysdeps/x86_64/dl-trampoline-save.h
 create mode 100644 sysdeps/x86_64/dl-trampoline-state.h
 create mode 100644 sysdeps/x86_64/tst-gnu2-tls2mod1.S

-- 
2.44.0


             reply	other threads:[~2024-04-01 20:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01 20:23 H.J. Lu [this message]
2024-04-01 20:23 ` [Backport: 1/6] x86: " H.J. Lu
2024-04-01 20:23 ` [Backport: 2/6] x86-64: Update _dl_tlsdesc_dynamic to preserve AMX registers H.J. Lu
2024-04-01 20:23 ` [Backport: 3/6] x86-64: Allocate state buffer space for RDI, RSI and RBX H.J. Lu
2024-04-01 20:23 ` [Backport: 4/6] Ignore undefined symbols for -mtls-dialect=gnu2 H.J. Lu
2024-04-01 20:23 ` [Backport: 5/6] arm: Update _dl_tlsdesc_dynamic to preserve caller-saved registers (BZ 31372) H.J. Lu
2024-04-01 20:23 ` [Backport: 6/6] elf: Enable TLS descriptor tests on aarch64 H.J. Lu

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

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

  git send-email \
    --in-reply-to=20240401202319.690253-1-hjl.tools@gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-stable@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).