From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id 49FF63858C41 for ; Mon, 7 Aug 2023 22:31:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 49FF63858C41 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4fe5ab64a26so5731402e87.2 for ; Mon, 07 Aug 2023 15:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1691447490; x=1692052290; 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=uAZTW/7LcEReBg2r4ULEb83qHXbFIFNt0uqeexbMNGw=; b=GepQCb2Tlmn8WoMRuOIKMeTaaw8s7Cm+iobONotaoCZl4SLQD1T3Ozkf62AjcOewvG u6KByX1U3wsOUWGyh0SA+IzBmvhtYnSwumAaRxAQ/BQofG5tTCewfxitd8JZlXRe0q7j UqBhxdveWmwy8DGrUqov9bN8Vn9bCQnH15CZmvq3wEs7Ig7IywfhOabKz1QKI54LmYUT Rb1ozySK+fWYPp6z8bfvIbT4y62th2LcQS4te/ZugCp8rTUrySnla06x+BvPm8nqytD3 ZMiRgdHJlpHZE7TmNYf1XoHSBbK+Ht1L9zlp/DdTb4zuKPp8YbxuQCV3GP6cf75G/YhJ F6hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691447490; x=1692052290; 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=uAZTW/7LcEReBg2r4ULEb83qHXbFIFNt0uqeexbMNGw=; b=BMmbkCGx6Lkg/eMF+qJcJriSo253/BxMaw0sYdOaNeLFFTWLjIjHAt9JkoNdrGOZpC 5z7HhrIhFaHWVLwmvU19KKxFGyxCZeYFA+9zrzjM1IV0gN1lUVyPsg+lmhV58JDyn48P bEWTPHTF5BsuoJIGrUz6Isp/DNEmjaP9klAq/Thy0o+dHrXNhJjh1h/vfv5VlW68Aq1a CFjiFdD2pLi0J7fTAQ9JyxzlYnB96dK+MTlQd4CGKwKqcuOQ1gmhbmOh6gbRz5S74JXD ABKSlBy8JSL1RdY73QwZpPEZ3i58CDZdy0506UlPvZ9C0Lv7RS32JJaOYph84iesO+ew tWLg== X-Gm-Message-State: AOJu0YxY8jyn8z6DbldUPxjQAmwO+vRDAS+sH/7R8LKpczGuHCZiB16i VlNGHfAAszFuc8zsKNhk3gEmkAzh/BimUHs5+Th21g== X-Google-Smtp-Source: AGHT+IHZD6gX63I/XEi46Yv6eJti0vOtSH8hfe4/yTi3dDvrKh6XGzDXvamJ34h7D8FbnhlRqbSvYj572I1wGYuukw4= X-Received: by 2002:a05:6512:3048:b0:4fe:5051:f253 with SMTP id b8-20020a056512304800b004fe5051f253mr8334966lfb.9.1691447489810; Mon, 07 Aug 2023 15:31:29 -0700 (PDT) MIME-Version: 1.0 References: <20230802155903.2552780-1-evan@rivosinc.com> <20230802155903.2552780-6-evan@rivosinc.com> <87il9w37vi.fsf@oldenburg.str.redhat.com> <6f0911c6-b24b-444c-4b4b-a62e49a51734@linaro.org> <548fc7d5-6225-69e7-f4a7-47669d2fdbd5@linaro.org> <878ramebon.fsf@oldenburg.str.redhat.com> In-Reply-To: <878ramebon.fsf@oldenburg.str.redhat.com> From: Evan Green Date: Mon, 7 Aug 2023 15:30:53 -0700 Message-ID: Subject: Re: [PATCH v6 5/5] riscv: Add and use alignment-ignorant memcpy To: Florian Weimer Cc: Richard Henderson , libc-alpha@sourceware.org, slewis@rivosinc.com, palmer@rivosinc.com, vineetg@rivosinc.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,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 Mon, Aug 7, 2023 at 3:21=E2=80=AFPM Florian Weimer = wrote: > > * Evan Green: > > > Right, this is what we had in the previous iteration of this series, > > and it did work ok. But it wasn't as good since it meant ifunc > > selectors always got stuck in the null/fallback case and were forced > > to make the syscall. With this mechanism they get to take advantage of > > the vDSO. > > The system call is only required when the IFUNC resolver is called in > advance of relocation. In most cases, the ELF dependencies work as > expected and ensure that the object containing the IFUNC resolver is > already relocation, and use of the fallback is avoided. Ah that's true, we did have to go through some hoops with LD_BIND_NOW and LD_PRELOAD to observe problems. So the cases where the __riscv_hwprobe_early() approach doesn't get to use the vDSO isn't "always" as I stated above but "certain exotic cases". I'm still leaning towards the ifunc parameter (now with inline helper in the header), but could be convinced to go back to the _early() function if there's some advantage to it. -Evan > > Thanks, > Florian >