From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id CD0333858D39 for ; Tue, 28 Mar 2023 23:41:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CD0333858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x235.google.com with SMTP id b19so10322328oib.7 for ; Tue, 28 Mar 2023 16:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680046874; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=XH6iXYYm/YrLR6pfy+iWCsmS5EpXPvHCcryyrQ7O5GQ=; b=yY9Ak+691+TmgZM6BK1L2Znfo61RpuTvRDgkeFDq8lk0CRvhN9SCJrtwuMQgiKOvu7 nygF4/i6E9Qp39yDGuUMtJ6DpFa6YsX0/hygvBcqHZzXxi80pEukxBWlou558oVtn/Cf 3W0BDx7sqEXGycwEzEh7cfSvAFvgV8RgcbwmxR6EjKKmn7MYAL0UARJ3p12mCmL6vDI+ vgrnG2VZa3EBIaziqwb1ATttu0RKkU/M6WGbuCV8Eb65otjZ3i3kEhHOpOPvOhdsM6IM rhCH9cMH4l0r5d06cITM5EEdWCv/VRYy3spwkRUBS5ORJNHbWNCQ06SuVkVAECoiN1s2 rqcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680046874; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XH6iXYYm/YrLR6pfy+iWCsmS5EpXPvHCcryyrQ7O5GQ=; b=R4P8ia39cokABEyz1UHbzG4BZUv54OhqM3K9U/Ty+bqOVBcaCpj5PNQflnwj31wQRy SZPnHSRTwk5jfDh+j/pwy9xIQ2+aHNYPsTl7vFfmzFzv9Yl4SUUF+tSJwdjcD7OcQN8R CRvrVzwofFxXqVe+abefLy1Ez281I86Is9lDwPoYEIHmPXMvCv0qe58TBCWeS3lxYinn 8rpj4v3TnSsZxvvPnm6N/sKWRnW+wO6hm7t2QOvenZYRaosH1vVkLbItvKKceV+XIrjq CHPavbZBe0VQAQpWd2MQQwx7cRrdIVmzaQ+DBpQvJd7GuW0BM2lJsbmTmfzqZyvxWXr7 RBdg== X-Gm-Message-State: AO0yUKVKvinHQJEz+V74iboihhvEZB+8mNlJBNf5DqLghS3UzPg+wHPX gNpvYlyRUBFI1UMWadJIP/qkHYa7fASuEMVNjlESWg== X-Google-Smtp-Source: AK7set9/YcwyZHtWnvXpq+ZI9U1rMPZkdZjqewqbBSCqbWEm1KD/zvjUdInBwBCrGbt+6ENd8KctNQ== X-Received: by 2002:a05:6808:6385:b0:387:64ee:eaca with SMTP id ec5-20020a056808638500b0038764eeeacamr7473009oib.30.1680046874122; Tue, 28 Mar 2023 16:41:14 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:60f9:1426:1d2d:d6b:1761? ([2804:1b3:a7c1:60f9:1426:1d2d:d6b:1761]) by smtp.gmail.com with ESMTPSA id r84-20020a4a3757000000b0053b592c5e24sm8869073oor.3.2023.03.28.16.41.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Mar 2023 16:41:13 -0700 (PDT) Message-ID: <60617016-c652-72b6-6d68-3d0efce74d74@linaro.org> Date: Tue, 28 Mar 2023 20:41:10 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v2 0/3] RISC-V: ifunced memcpy using new kernel hwprobe interface Content-Language: en-US To: Palmer Dabbelt , Evan Green Cc: libc-alpha@sourceware.org, slewis@rivosinc.com, Vineet Gupta References: From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: On 28/03/23 19:54, Palmer Dabbelt wrote: > On Tue, 21 Feb 2023 11:15:34 PST (-0800), Evan Green wrote: >> >> This series illustrates the use of a proposed Linux syscall that >> enumerates architectural information about the RISC-V cores the system >> is running on. In this series we expose a small wrapper function around >> the syscall. An ifunc selector for memcpy queries it to see if unaligned >> access is "fast" on this hardware. If it is, it selects a newly provided >> implementation of memcpy that doesn't work hard at aligning the src and >> destination buffers. >> >> This is somewhat of a proof of concept for the syscall itself, but I do >> find that in my goofy memcpy test [1], the unaligned memcpy performed at >> least as well as the generic C version. This is however on Qemu on an M1 >> mac, so not a test of any real hardware (more a smoke test that the >> implementation isn't silly). > > QEMU isn't a good enough benchmark to justify a new memcpy routine in glibc.  Evan has a D1, which does support misaligned access and runs some simple benchmarks faster.  There's also been some minor changes to the Linux side of things that warrant a v3 anyway, so he'll just post some benchmarks on HW along with that. > > Aside from those comments, > > Reviewed-by: Palmer Dabbelt > > There's a lot more stuff to probe for, but I think we've got enough of a proof of concept for the hwprobe stuff that we can move forward with the core interface bits in Linux/glibc and then unleash the chaos... > > Unless anyone else has comments? Until riscv_hwprobe is not on Linus tree as official Linux ABI this patchset can not be installed. We failed to enforce it on some occasion (like Intel CET) and it turned out a complete mess after some years...