public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org, Sunil K Pandey <skpgkp2@gmail.com>
Subject: Re: [PATCH] Revert "x86_64: Suppress false positive valgrind error"
Date: Sat, 13 Apr 2024 08:49:48 -0700	[thread overview]
Message-ID: <CAMe9rOrhjcy49QsHKnjF6fsTfpjQQ1v406d0QgCr71debTSFBw@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOpB0HirTKCs+My4VYeebUZOTWZs1aSGw+SALNyf0zKMEw@mail.gmail.com>

On Sat, Apr 13, 2024 at 8:27 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Sat, Apr 13, 2024 at 8:20 AM Florian Weimer <fweimer@redhat.com> wrote:
> >
> > * H. J. Lu:
> >
> > > On Sat, Apr 13, 2024 at 8:03 AM Florian Weimer <fweimer@redhat.com> wrote:
> > >>
> > >> * H. J. Lu:
> > >>
> > >> > On Sat, Apr 13, 2024 at 7:49 AM Florian Weimer <fweimer@redhat.com> wrote:
> > >> >>
> > >> >> This reverts commit a1735e0aa858f0c8b15e5ee9975bff4279423680.
> > >> >>
> > >> >> The test failure is a real valgrind bug that needs to be fixed before
> > >> >> valgrind is usable with a glibc that has been built with
> > >> >> CC="gcc -march=x86-64-v3".  The valgrind fix addresses the observed
> > >> >> test failure as well.
> > >> >>
> > >> >> Upstream bug: <https://bugs.kde.org/show_bug.cgi?id=485487>
> > >> >>
> > >> >> Tested on x86_64-linux-gnu with and without CC="gcc -march=x86-64-v3".
> > >> >> The elf/tst-valgrind-smoke tests again fails with an unpatched valgrind,
> > >> >> and the proposed upstream patch fixes it.  (Apparently, valgrind
> > >> >> matches on soname, and not the file name, which is ld.so in the test.)
> > >> >
> > >> > Please clarify that your patch fixes the glibc valgrind test by not using
> > >> > strcmp-avx2.S in the valgrind test.
> > >>
> > >> Sorry, clarify where?  In the commit message here?  On the upstream bug?
> > >
> > > In the glibc commit message.
> > >
> > >> My valgrind patch replaces the strcmp implementation in ld.so with its
> > >> own.
> > >>
> > >
> > > Please mention it in the glibc commit message.
> >
> > Okay, I'll send a v2.
> >
> > Could someone proficient in x86-64 assembly have a look at my strcmp
> > implementation?
>
> Can you adapt sysdeps/i386/i686/strcmp.S for valgrind?
>

You can use sysdeps/x86_64/strcmp.S from glibc 2.10:

ENTRY (BP_SYM (strcmp))
L(oop): movb (%rdi), %al
cmpb (%rsi), %al
jne L(neq)
incq %rdi
incq %rsi
testb %al, %al
jnz L(oop)

xorl %eax, %eax
ret

L(neq): movl $1, %eax
movl $-1, %ecx
cmovbl %ecx, %eax
ret
END (BP_SYM (strcmp))


-- 
H.J.

  reply	other threads:[~2024-04-13 15:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-13 14:48 Florian Weimer
2024-04-13 14:58 ` H.J. Lu
2024-04-13 15:03   ` Florian Weimer
2024-04-13 15:09     ` H.J. Lu
2024-04-13 15:20       ` Florian Weimer
2024-04-13 15:27         ` H.J. Lu
2024-04-13 15:49           ` H.J. Lu [this message]
2024-04-13 15:52             ` Florian Weimer
2024-04-13 15:56               ` H.J. Lu
2024-04-13 17:50                 ` Florian Weimer
2024-04-13 15:21 Florian Weimer
2024-04-13 15:27 ` 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=CAMe9rOrhjcy49QsHKnjF6fsTfpjQQ1v406d0QgCr71debTSFBw@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=skpgkp2@gmail.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).