public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Sergey Bugaev <bugaevc@gmail.com>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
	libc-alpha@sourceware.org, bug-hurd@gnu.org,
	 Samuel Thibault <samuel.thibault@gnu.org>,
	Luca <luca@orpolo.org>
Subject: Re: [VERY RFC PATCH 2/2] hurd: Make it possible to call memcpy very early
Date: Fri, 21 Apr 2023 12:27:24 +0300	[thread overview]
Message-ID: <CAN9u=Hc3XqG2kGsHi827=+1ObO3RFTeW2NGqCsc9ZgDqCa2VgQ@mail.gmail.com> (raw)
In-Reply-To: <ca899248-eeee-d9a3-cd79-c19ddd043aae@linaro.org>

Hello,

On Thu, Apr 20, 2023 at 11:38 PM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
> Can't you use a similar strategy done by 5355f9ca7b10183ce06e8a18003ba30f43774858 ?

Do I understand it right that that is the moral equivalent of

#define memcpy __memcpy_sse2_unaligned

except that it works aat assembly level and so will catch implicit
calls to memcpy that the compiler may insert?

Assuming for a second that we don't care about implicit memcpys (but
we should) and only about the explicit one made by the MIG runtime, we
could maybe even just do

 void *
 __mig_memcpy (void *dst, const void *src, vm_size_t len)
 {
-  return memcpy (dst, src, len);
+  return __memcpy_sse2_unaligned (dst, src, len);
 }

but that (as well as your proposal) would make *all* calls to memcpy
in this place go through the baseline version, even after the early
startup is done. Whereas my proposal attempted to avoid that -- unless
of course H.J. is right and this prevents the indirect relocation from
replacing the function pointer later, in which case it's even worse
because it would sabotage memcpy for the whole program and not just a
couple of files.

Sergey

  reply	other threads:[~2023-04-21  9:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 18:42 [PATCH 1/2] hurd: Don't migrate reply port into __init1_tcbhead Sergey Bugaev
2023-04-20 18:42 ` [VERY RFC PATCH 2/2] hurd: Make it possible to call memcpy very early Sergey Bugaev
2023-04-20 20:25   ` H.J. Lu
2023-04-20 20:38     ` Adhemerval Zanella Netto
2023-04-21  9:27       ` Sergey Bugaev [this message]
2023-04-21 11:50         ` Adhemerval Zanella Netto
2023-04-21 12:38           ` Sergey Bugaev
2023-04-21 12:58             ` Adhemerval Zanella Netto
2023-04-21 13:56               ` Sergey Bugaev
2023-04-21 14:28                 ` Adhemerval Zanella Netto
2023-04-22 11:59                 ` Samuel Thibault
2023-04-22 12:18                   ` Sergey Bugaev
2023-04-22 16:20                     ` Samuel Thibault
2023-04-22 17:04                       ` Sergey Bugaev
2023-04-21 11:51     ` Sergey Bugaev
2023-04-21  1:02 ` [PATCH 1/2] hurd: Don't migrate reply port into __init1_tcbhead Samuel Thibault

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='CAN9u=Hc3XqG2kGsHi827=+1ObO3RFTeW2NGqCsc9ZgDqCa2VgQ@mail.gmail.com' \
    --to=bugaevc@gmail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=bug-hurd@gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=luca@orpolo.org \
    --cc=samuel.thibault@gnu.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).