From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by sourceware.org (Postfix) with ESMTPS id C8EA93858C50 for ; Mon, 6 Feb 2023 21:29:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8EA93858C50 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-pf1-x444.google.com with SMTP id g9so9376207pfo.5 for ; Mon, 06 Feb 2023 13:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=cqB7lgfvdD0uV0v6khlJP3Jk7eSlRQ9kD/YlDwLP4CE=; b=cLt4s1W3pyQ/PLly7LDCPvamiRtgGEbOi1krJN6ShCNx1w2Cy4kufWf5FLqlPddF/B ZEhLX4ly9KRGWCdYREZAzBaF3jwGEqxlIkCr9cI/aJkQAIqSov+G7x32eFSY3NGLqOHE KMDRO4DcsidIFs4MMWk2qVGeS4eJZiN7F8HKOtbEYwaNDUqGTd4gf9UD8p+qFcwZiuNQ 4j57uHdjrnwg/0FKC11nG4l7STggLqJOC6MUdhd9fjisLeQ1S25fw0eT+hrqaVCnQAdm h9fk80ADmLEy6fi7bmOmBNiJjzmXsTJl38CNFWknNDJaYK/E2wqjXmzN1PIl9mXSXmkr 5u1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to: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=cqB7lgfvdD0uV0v6khlJP3Jk7eSlRQ9kD/YlDwLP4CE=; b=rukl3+Hhr+B1Dg3B/5yFmZ9xAbrkaf3Czru5EvoyR9XeJ2ainfDaBWKv02Z0n1SM16 2QzkhX910oaORN3+wMGPXiR2jBPTRwgnnW0rMayAu/6YtkNbTPMSygfwGlGyxyWIBVjm uaW/bX7XLwuiUs7ndqNU9Kok4QGj6SO7D3RGG8pBrPrYYFCLnCpgbwp1mQj8zA1rtPpC jncOPZ+V6uxwgTU7DIPSwpRIHrCZPnNYz4sdpaWGbV1/u70krH0/DH3moyvejSpwNhZY E71fgLpfqqJFylVxOhwTneVlnLC8CulnMkJjK5rI8ue1Xi71B8mnlM4B+bxYbPhvT+M6 8gGg== X-Gm-Message-State: AO0yUKU5Jnp/bMp9juJXbaOr+diEhpvbUzJA2ZLP/4cfZ4RhTSUjmDs4 bfTl/yBPlb/27A7YRz979fcOsw== X-Google-Smtp-Source: AK7set886B+vU4Rt9V1/ebv9cd1OibVPhHhpxo5PQOgu2b1cmjoy6pHCjAgRG/+vl0tFa3UsurXxXQ== X-Received: by 2002:a62:6c7:0:b0:593:adfa:84f6 with SMTP id 190-20020a6206c7000000b00593adfa84f6mr772470pfg.23.1675718986637; Mon, 06 Feb 2023 13:29:46 -0800 (PST) Received: from [172.20.101.2] (rrcs-74-87-59-235.west.biz.rr.com. [74.87.59.235]) by smtp.gmail.com with ESMTPSA id z9-20020aa79589000000b0058e23ca0ca7sm7594030pfj.3.2023.02.06.13.29.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Feb 2023 13:29:46 -0800 (PST) Message-ID: <878ce324-c4d7-5fc5-b964-d59220f724d2@linaro.org> Date: Mon, 6 Feb 2023 11:28:49 -1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 0/2] RISC-V: ifunced memcpy using new kernel hwprobe interface Content-Language: en-US To: Evan Green , libc-alpha@sourceware.org Cc: slewis@rivosinc.com, vineetg@rivosinc.com, palmer@rivosinc.com References: <20230206194819.1679472-1-evan@rivosinc.com> From: Richard Henderson In-Reply-To: <20230206194819.1679472-1-evan@rivosinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,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 2/6/23 09:48, 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). > > v1 of the Linux series can be found at [2]. I'm about to post v2 (but > haven't yet!), I can reply here with the link once v2 is posted. > > [1] https://pastebin.com/Nj8ixpkX > [2] https://yhbt.net/lore/all/20221013163551.6775-1-palmer@rivosinc.com/ Re the syscall: I question whether the heterogenous cpu case is something that you really want to query. In order to handle migration between such cpus, any such query must return the minimum level of support. Remove that possibility, and this becomes a simple array reference. Now you need to decide whether a vdso call, or HWCAP2 as pointer to read-only data is more or less efficient or extensible. r~