From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 7428D386483B for ; Thu, 15 Feb 2024 15:57:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7428D386483B Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7428D386483B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::231 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708012662; cv=none; b=Yo9SgfLRdmySzHG0SAClVpEyCXwdLdZo/0C5Y6Bpe7QSJljKYuHSoQRbgWIzd2V5ZSqtnJATP6uBBuEL8vXIst+FvbJn8UT/HsmhqqvQ/NxLcGJEhNMNTN/vXGTAt3SZfUiudjnC0DscmA51eCmSakcsy06Je6Epfv2iTR/vWSU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708012662; c=relaxed/simple; bh=1/da2HBfAoPtee0Gh+l4Zeeoj1WlgESW7rzLx6vIHjo=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=ggEizqBCdZdVjvcOIKq3y+GXzPMueFH6492dOSUaVsXe41b4UShORgfxrWJcKsI7ijcvinrFf8AJ2oubWiuUKJ4BGW2w8Dqdbe0GKurip3AesT5FAplydDRK/L9+VFNohd3JTcArPnvlKSAoGkyHw1+dbvX5xqvotbROiArT5PE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3c0467b94c6so651449b6e.0 for ; Thu, 15 Feb 2024 07:57:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708012659; x=1708617459; 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=1/da2HBfAoPtee0Gh+l4Zeeoj1WlgESW7rzLx6vIHjo=; b=Xqb4SoX8cOK0HXArsNB0GXytZip8NTaS+5m9Zh+z+dAQDL9CatZPB04IMqxRKLaJSP NmDo1q/shgk4iM7OX/Br4uPs9L2/2DPe/T7uAaDNRaZRMMOEcvzT+qxUWD9I3QgaAFNs WnFsQmrFk7ovJ9IoOxXe6sN5pkxaW1dkqrhPlcjwdTljw4SlgXCnNuCc1vY8mOTYKTC6 ZVG7f0ZvbbFy7iw15Fm32ZAXTpxdb12n6YpnSl9uknGF7nT7O90gPPzXU5y0c/fDOKui PGPSD0HL7eONxHM4l2r4grsgcFNB59OsjlT7aCZPpRIY6u21xF8xgeG7KqbRd6GTBGBO xN7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708012659; x=1708617459; 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=1/da2HBfAoPtee0Gh+l4Zeeoj1WlgESW7rzLx6vIHjo=; b=kU7FzMXnQv0R1/N9piiA3su2jxBGK5oDqPgtWFc6qOyxsjyA/GrhaFSwRcIC//MABc XSgOOXccwWvc7txiJc0WYnu+1zfrvRpCNUgZvlQ5LxcdMIiCCoEAg4vPP/e16e2h38fr pw3AOlLE9fEPhd2sIhcGBvfHCEeuD8atcC3qEHlGcUpd3z9MGAOO4rfaKBDRzWbPFCo6 DYVncY/m8APapzRo5DSJNi21PyIjN1Cry1QAAOiQQtwb4pS40YeZ+PmyNhRdNFK4yf/r 1ktgZ/4pYIsiD0C2v2D4BKHnJ5kIUFP0GqKvQgqPA5rsYwuToqhbgwUitrPt+p9qPIb/ 3I9w== X-Forwarded-Encrypted: i=1; AJvYcCUsXO6ujm0DsmAoZCl0UaFyZh76oVVKaVCgFYEuALrsApkbmkHHEZyyIrIn0/CQOGJJ/6c7ss/NgO+TUk3Jz77Za1pVzZyKISDr X-Gm-Message-State: AOJu0YzqTTS42ktjqgqCmaNvClOl8bHmK8TGskqWhMXa3j9Y1ttpUwr/ RDo5slnQykjKBQsMsBRBba4EmD+wkva58GYhCo49O6sjAan+bdocVF1AgEyW+MRegy/73S4yA1R r5v2/62nQfrlHhPBMe0kpMRACwXmr6tq9QE83 X-Google-Smtp-Source: AGHT+IEhbM8a/w5PMWTBqR+RCfFnLITJRpwkQNWn0z7LGt4kSI13PLqHw3WAP0szQ/RaOqWGUd5Kxkd8wUY6g1I5WWw= X-Received: by 2002:a05:6808:169f:b0:3c1:33a1:5ab4 with SMTP id bb31-20020a056808169f00b003c133a15ab4mr2527058oib.23.1708012659427; Thu, 15 Feb 2024 07:57:39 -0800 (PST) MIME-Version: 1.0 References: <20240214143159.2951158-1-evan@rivosinc.com> In-Reply-To: From: enh Date: Thu, 15 Feb 2024 07:57:27 -0800 Message-ID: Subject: Re: [PATCH v12 0/7] RISC-V: ifunced memcpy using new kernel hwprobe interface To: Evan Green Cc: Adhemerval Zanella Netto , 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=-18.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Thu, Feb 15, 2024 at 7:49=E2=80=AFAM Evan Green wrot= e: > > 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 = that > > > enumerates architectural information about the RISC-V cores the syste= m > > > is running on. In this series we expose a small wrapper function arou= nd > > > the syscall. An ifunc selector for memcpy queries it to see if unalig= ned > > > access is "fast" on this hardware. If it is, it selects a newly provi= ded > > > implementation of memcpy that doesn't work hard at aligning the src a= nd > > > destination buffers. > > > > > > For applications and libraries outside of glibc that want to use > > > __riscv_hwprobe() in ifunc selectors, this series also sends a pointe= r > > > 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 AB= I [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.htm= l > > 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 :) certainly on Android we looked at the amount of work that would require (and the likely slowdown to dynamic linking, which is already problematic for us, given that it's a large component of app launch time that our zygote trick can't magic away) and decided that we're unlikely to do it, even though in principle it's a nice idea. > 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