From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id D27543861863 for ; Thu, 15 Feb 2024 15:48:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D27543861863 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D27543861863 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::229 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708012132; cv=none; b=sO/QRVmieG3DIcreyh3rd0hh7v7OkSJ40aZxAiZrobrmS7OTH/lJQKdIJApVdmqtLbG6BjReBI3HgCnZIqE9zroWanH2F0F+oHKF/t6hUir65SRcdZDYxiCG3nMD6fZxcCuqs2jVdiP69K27O9fyXU+34l4F+ibc9YN+UfV+7Ro= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708012132; c=relaxed/simple; bh=YhuukETagBovTsnT575nbPPI31dUgd27LUU2SYZcHS0=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=PUlTNn0RxA7cD5gyGoZM3hDtyCxF3ZkSm8b7NNp7MGwae3v5SGC3AZEai8eHSyde0V/riBfqAIlbJK9jtpaLAQm3yiUj7g2TtnaX+Fx3ad5Uz27SLBHiOlOK5Xuqg+WU7QcTjCfXUOxOD39JGZTwF0l4zkjsmp5pCqhZCkGLEsA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2d0c9967fdcso22228441fa.0 for ; Thu, 15 Feb 2024 07:48:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1708012120; x=1708616920; darn=sourceware.org; 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=YhuukETagBovTsnT575nbPPI31dUgd27LUU2SYZcHS0=; b=jgme4l9+7yJ3pkKGWg55UyHRUPLK4uP/jlBYv3gfedU8XFWeDrdGZraiVt8nWURZqO LPPDqMpPRABGGH1L77Pa8Tj6mrJkABRx/+9sJ80c5KmTAwlLaRkT5V1o6xS2Z+t57Id7 A+R8svdC3Oznftyf2784ah0/R8oR9ZAgDKdZX06Mgv71SCS+hCTW5sU9FQzpjDNd1vVC BYx4QLTkbhU+Z2hqJZcZpqYLq9x8ITLbgx6Pyr4KDfViIqCu5vhdb31AjQVqENiX5hO6 9F7G19Xl9axPaNH1bkeqHQ25nCImQxC8OpHYz/gF815F706hPguKx74SMI+QSmNnuldC ztDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708012120; x=1708616920; 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=YhuukETagBovTsnT575nbPPI31dUgd27LUU2SYZcHS0=; b=uPZ7o3UqHVP6E1R6+cXC2bK1uj+CRUCRIluaXAEshljy2RnUIfPmydbXFiq7MTQG0c +WE14R2dp99ufwNQjkmiQ4cThTYYTkS/WD8U8CIXNgvb0WT+DGLFv8WUJslfLCIrCQze 0dp3F1Ctvcsw5C1bl56UMaatgfh3fjOgs61UEr9w+1PkYA82RGhUu4bjiTO7X10r2N6S SJldM7Sd5NbGwLy7wJ0qkMEnrc/JpQktuSG5xwZVICPQldsc+jNg+UQjMeyolnocK9Tb ynLT0K6dM1rwLfuEgAMj1WG8S6RXM6+ZU7Jpk2gwH04PmYAl2RZ5YKyHECe0kWi8ZPm9 l3hA== X-Gm-Message-State: AOJu0YxOcfWnUye7mmpAYbcHW6zurFDxBPO49hevWBio6endgu4X5DxJ D4Jn4szRHfAnBFENE2L9Y0C6VkzZoG+mGxmAr69gmEPARfYOVJdL07QtAUu5oXmlFuALVSvWfxR NfQpPDVAG8+4e5hJug4fK/sW5JPf0bC+zXEsTDj2tN/Ql5M+T X-Google-Smtp-Source: AGHT+IHDqSSU1sBKjEMJVzyEzPlG5jZCWyO7XdN7o2zKNfbs03w+FJBFs6uvbRB5UI42f+BAPttBsJrdykDayxXOkx8= X-Received: by 2002:a05:6512:604:b0:511:8e03:e0ba with SMTP id b4-20020a056512060400b005118e03e0bamr779822lfe.7.1708012120266; Thu, 15 Feb 2024 07:48:40 -0800 (PST) MIME-Version: 1.0 References: <20240214143159.2951158-1-evan@rivosinc.com> In-Reply-To: From: Evan Green Date: Thu, 15 Feb 2024 10:48:03 -0500 Message-ID: Subject: Re: [PATCH v12 0/7] RISC-V: ifunced memcpy using new kernel hwprobe interface To: Adhemerval Zanella Netto Cc: libc-alpha@sourceware.org, vineetg@rivosinc.com, Florian Weimer , slewis@rivosinc.com, palmer@rivosinc.com, Jessica Clarke Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,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: On Wed, Feb 14, 2024 at 10:16=E2=80=AFAM Adhemerval Zanella Netto wrote: > > > > On 14/02/24 11:31, Evan Green wrote: > > > > This series illustrates the use of a recently accepted Linux syscall th= at > > 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 unaligne= d > > access is "fast" on this hardware. If it is, it selects a newly provide= d > > implementation of memcpy that doesn't work hard at aligning the src and > > destination buffers. > > > > For applications and libraries outside of glibc that want to use > > __riscv_hwprobe() in ifunc selectors, this series also sends a pointer > > to the riscv_hwprobe() function in as the second argument to ifunc > > selectors. A new inline convenience function can help application and > > library callers to check for validity and quickly probe a single key. > > I still think we should address Jessica Clarke remarks for the ifunc ABI = [1]. > I recall that Florian has tried to address the ifunc ordering and that > Jessica proposed solutions was not fully sufficient to address all the > ifunc corner cases. > > [1] https://sourceware.org/pipermail/libc-alpha/2024-January/154082.html I haven't invested the time yet in studying the resolver to understand how feasible Jessica's suggestion is. I was sort of hoping Florian would chime in with an "oh yeah let's do that" or "no, it doesn't work". I suppose I still am :) Alternatively, patches 1-3 of this series stand on their own. If the ifunc aspect of this is gated on me doing a bunch of research, it might at least make sense to land the first half now, to get Linux users easy access to the __riscv_hwprobe() syscall and vDSO. -Evan