From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by sourceware.org (Postfix) with ESMTPS id 904DD3858D37 for ; Fri, 21 Apr 2023 09:27:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 904DD3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-187993bab0cso1421865fac.3 for ; Fri, 21 Apr 2023 02:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682069256; x=1684661256; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vAryTHJ89RMdXXNLs5J8gk4RjGn29ahF/STzTR9WsF8=; b=IjqW3OHalFBxaLzldzgoRQQFVN/f2vLXqYeJNVffTPwtTxrUqTNUG7oprxacS9fHnv G+iCOtHwV+xhfomv9JpzqyFyPvnpWdqPuYaWd6CXRgxXotrhcla51tdkXIF2i/0DDeJD Hw1CA25BuAoDqtH7uWts36OTFc0sxEtVlU6dsQe3DfekAUh027pPKS9jY8sVXSWBo27o m0y3FgvjojpF5GQBC9JD8RdqgebBT9aWf6mQJQ1XjVsyUr7+WQ6bL9b/UPoGxz4cKZVf OOYjwC9svYNrH+nTNz1jvBCbk4XLl2QWPDmke5UAKj7cSYv2kEO6fxnV885IPbhq8132 0XmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682069256; x=1684661256; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vAryTHJ89RMdXXNLs5J8gk4RjGn29ahF/STzTR9WsF8=; b=Vi6UzSQeYGZxMG0+18qZ9jyNj0p3f/4ad+BQqtO0v3egtm8PR3kMuBdiLgu12eLIcu By6GEOmtpp/ZIntct7xm+VL0UUCesgGG8EIyQnwpNQ8g6EK8ALf8fGtYS1jtp7e3AeYM pbawx9/ofHJOfxbmWRM6wCuLdXWHG/3fGC+FMjuEK1F40ANlaa8KyGmqL14pofQSeoiK NG3qzUz9SCA/xJROJxScVkoV9+rC9xdNV0WnXtnsijd+dPDDNC89c8le2OWScO/IPcnG W4Nisawg6p2tXLJ0cQpj8Y0gkKCCR2UDG110OfEqkt/mt6JMKrWiNZSWxi1yO8HcCjqf OX7g== X-Gm-Message-State: AAQBX9c/7U4SzPAgMLHH3sJbBj3CCPquLgkPXzJ5qiwo+lpadoXlLIV1 ib8W3xKbwU82hsOgZ1zpO4xnV73lDEKZ3IDabw8PfUknr+dXVQ== X-Google-Smtp-Source: AKy350YXMAhiHVql0Oye1Fks/54sxd/N2DVcy5U6Ss9/ipIRaRsDzDciYqf8IaVEz8yf04xHsXqZxohu3+yx/M+yScU= X-Received: by 2002:a05:6870:4191:b0:177:809e:ead3 with SMTP id y17-20020a056870419100b00177809eead3mr3820618oac.41.1682069255631; Fri, 21 Apr 2023 02:27:35 -0700 (PDT) MIME-Version: 1.0 References: <20230420184220.300862-1-bugaevc@gmail.com> <20230420184220.300862-2-bugaevc@gmail.com> In-Reply-To: From: Sergey Bugaev Date: Fri, 21 Apr 2023 12:27:24 +0300 Message-ID: Subject: Re: [VERY RFC PATCH 2/2] hurd: Make it possible to call memcpy very early To: Adhemerval Zanella Netto Cc: "H.J. Lu" , libc-alpha@sourceware.org, bug-hurd@gnu.org, Samuel Thibault , Luca Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, On Thu, Apr 20, 2023 at 11:38=E2=80=AFPM Adhemerval Zanella Netto wrote: > Can't you use a similar strategy done by 5355f9ca7b10183ce06e8a18003ba30f= 43774858 ? 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