public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Evan Green <evan@rivosinc.com>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org, vineetg@rivosinc.com,
	slewis@rivosinc.com,  Florian Weimer <fweimer@redhat.com>,
	palmer@rivosinc.com,  Andreas Schwab <schwab@linux-m68k.org>
Subject: Re: [PATCH v13 7/7] riscv: Add and use alignment-ignorant memcpy
Date: Mon, 4 Mar 2024 11:35:29 -0800	[thread overview]
Message-ID: <CALs-HsuHrG+kbMx4FoEU+2CwoQpb7ssXBU-kd9obNdLS9JhF7w@mail.gmail.com> (raw)
In-Reply-To: <d01c1761-feb8-41b9-a030-3db586432db3@linaro.org>

On Mon, Mar 4, 2024 at 10:30 AM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 02/03/24 07:33, Andreas Schwab wrote:
> > On Feb 27 2024, Evan Green wrote:
> >
> >> For CPU implementations that can perform unaligned accesses with little
> >> or no performance penalty, create a memcpy implementation that does not
> >> bother aligning buffers. It will use a block of integer registers, a
> >> single integer register, and fall back to bytewise copy for the
> >> remainder.
> >
> > How has that been tested?  It causes memory corruption.
> >
>
> The memcpy optimization has multiple issues:
>
>  1. The implementation is wrong: the chunk size calculation is wrong
>  leading to invalid memory access.
>
>  2. It adds ifunc supports as default, so --disable-multi-arch does
>  not work as expected for riscv.
>
>  3. It mixes Linux files (memcpy ifunc selection which requires the
>  vDSO/syscall mechanism) with generic support (the memcpy
>  optimization itself).
>
>  4. There is no __libc_ifunc_impl_list, which makes testing only
>  check the selected implementation instead of all supported
>  by the system.
>
> The 2., 3., and 4. are not really a problem since they came most likely
> from code base inexperience. However, the 1. is *really* a red
> flag since it means that you did not run a 'make check' to certify
> no regressions were found.

This is my bad. My testing for this series involved boot testing, plus
some tests I had written specifically for this, as well as
build-many-glibcs. Make check was not on my radar, and clearly should
have been. Thanks for coming in with a quick fix. I'll take a look at
what you've done and holler if I see any issues.
-Evan

  reply	other threads:[~2024-03-04 19:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 22:56 [PATCH v13 0/7] RISC-V: ifunced memcpy using new kernel hwprobe interface Evan Green
2024-02-27 22:56 ` [PATCH v13 1/7] riscv: Add Linux hwprobe syscall support Evan Green
2024-02-27 22:56 ` [PATCH v13 2/7] linux: Introduce INTERNAL_VSYSCALL Evan Green
2024-02-27 22:56 ` [PATCH v13 3/7] riscv: Add hwprobe vdso call support Evan Green
2024-02-27 22:56 ` [PATCH v13 4/7] riscv: Add __riscv_hwprobe pointer to ifunc calls Evan Green
2024-02-27 22:56 ` [PATCH v13 5/7] riscv: Enable multi-arg ifunc resolvers Evan Green
2024-02-27 22:56 ` [PATCH v13 6/7] riscv: Add ifunc helper method to hwprobe.h Evan Green
2024-02-27 22:56 ` [PATCH v13 7/7] riscv: Add and use alignment-ignorant memcpy Evan Green
2024-03-02 10:33   ` Andreas Schwab
2024-03-04 18:30     ` Adhemerval Zanella Netto
2024-03-04 19:35       ` Evan Green [this message]
2024-03-02 13:52   ` Andreas Schwab
2024-03-01 15:19 ` [PATCH v13 0/7] RISC-V: ifunced memcpy using new kernel hwprobe interface Palmer Dabbelt

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=CALs-HsuHrG+kbMx4FoEU+2CwoQpb7ssXBU-kd9obNdLS9JhF7w@mail.gmail.com \
    --to=evan@rivosinc.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=palmer@rivosinc.com \
    --cc=schwab@linux-m68k.org \
    --cc=slewis@rivosinc.com \
    --cc=vineetg@rivosinc.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).