public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jon@solid-run.com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/28432] New: Aarch64 memcpy used on device-memory
Date: Thu, 07 Oct 2021 12:39:28 +0000	[thread overview]
Message-ID: <bug-28432-131@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=28432

            Bug ID: 28432
           Summary: Aarch64 memcpy used on device-memory
           Product: glibc
           Version: 2.32
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: jon@solid-run.com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 13713
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13713&action=edit
patch to memcpy memmove for better device-memory compatibility

It was first reported 4 years ago with the Macchiatobin writing to a memory
mapped framebuffer of a PCIe device.  The error was narrowed down to
overlapping stps causing device memory to be 0'd out or not written at all. 
There were many discussions on if it was valid to use mem* functions on device
memory mapped as uncached / writecombined.  Recently I tracked down a rendering
problem on the HoneyComb LX2K to a similar failure.  Since between the 3 SOCs,
the only similarity is the Cortex-A72 cores (They all have different
combinations of CCN's and PCIe IP) I started looking a bit more into possible
causes.  I came across this documentation regarding how the Cortex-A72 does ACE
transfers, https://developer.arm.com/documentation/100095/0001/way1381846851421

because I had already narrowed down the failure to memcpy's of 97-110 size
unaligned copies I realized that it was always the last 2 stp's of the copy96
routine. Since the ordering should not matter, I instead moved the backwards
copy to happen first which would then allow from what I understand of the
document above the 4 forward progressing stp's could be sent as a single
4x128bit WRAP write.

This does fix the issue I was trying to solve in both my specific test case as
well as a few real world rendering failures.  Since we are only re-ordering
stp's there should be no functional or performance regressions, and all the
glibc test's do pass.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2021-10-07 12:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 12:39 jon@solid-run.com [this message]
2021-10-07 12:59 ` [Bug libc/28432] " adhemerval.zanella at linaro dot org
2021-10-13 12:36 ` wdijkstr at arm dot com
2021-10-13 16:36 ` jon@solid-run.com
2021-10-13 18:28 ` nsz at gcc dot gnu.org
2021-10-14  4:15 ` jon@solid-run.com
2021-10-14  8:53 ` david at qore dot org
2021-10-25 16:46 ` nsz at gcc dot gnu.org
2021-10-26  7:01 ` jon@solid-run.com
2021-11-29 16:18 ` sam at gentoo dot org

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=bug-28432-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@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).