public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: "Paul E. Murphy" <murphyp@linux.vnet.ibm.com>, libc-alpha@sourceware.org
Subject: Re: [PATCHv2] powerpc64le/power9: guard power9 strcmp against rtld usage [BZ# 25905]
Date: Mon, 4 May 2020 13:36:18 -0300	[thread overview]
Message-ID: <f6729e18-ad57-1617-7139-21145dd29844@linaro.org> (raw)
In-Reply-To: <20200504152503.9608-1-murphyp@linux.vnet.ibm.com>



On 04/05/2020 12:25, Paul E. Murphy wrote:
> Use rtld-strcpy.S file in power9 to redirect to power8 implementation
> instead.  This builds the power8 strcpy rtld with --with-cpu=power9 and

s/strcpy/strcmp.

> --disable-multi-arch.  The existing behavior is unchanged when
> multi-arch is enabled.

LGTM thanks.

As a side note, is strcmp the only string routine that used in lazy
resolution?

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> 
> ---8<---
> strcmp is used while resolving PLT references.  Vector registers
> should not be used during this.  The P9 strcmp makes heavy use of
> vector registers, so it should be avoided in rtld.
> 
> This prevents quiet vector register corruption when glibc is configured
> with --disable-multi-arch and --with-cpu=power9.  This can be seen with
> test-float64x-compat_totalordermag during the first call into
> totalordermagf64x@GLIBC_2.27.
> 
> Add a guard to fallback to the power8 implementation when building
> power9 strcmp for libraries other than libc.
> ---
>  sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S | 2 ++
>  1 file changed, 2 insertions(+)
>  create mode 100644 sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S
> 
> diff --git a/sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S b/sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S
> new file mode 100644
> index 0000000000..afdb492b3d
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/le/power9/rtld-strcmp.S
> @@ -0,0 +1,2 @@
> +/* Fallback to P8 which does not use vector regs for rtld.  */
> +#include <sysdeps/powerpc/powerpc64/power8/strcmp.S>
> 

  reply	other threads:[~2020-05-04 16:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 20:32 [PATCH] " Paul E. Murphy
2020-05-04 12:26 ` Adhemerval Zanella
2020-05-04 15:25   ` [PATCHv2] " Paul E. Murphy
2020-05-04 16:36     ` Adhemerval Zanella [this message]
2020-05-04 18:02       ` Paul E Murphy
2020-05-04 18:26         ` Adhemerval Zanella
2020-05-04 21:16           ` Paul E Murphy
2020-05-05 21:01             ` 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

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

  git send-email \
    --in-reply-to=f6729e18-ad57-1617-7139-21145dd29844@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=murphyp@linux.vnet.ibm.com \
    /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).