Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2598689pxb; Thu, 3 Feb 2022 09:51:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPHDxXYQeImEeU6siwq+EEuaMB26TTvk50DJrzsau9oPjmVvwLSwtmwadOP3tHdeVgGlM5 X-Received: by 2002:a17:907:d9e:: with SMTP id go30mr30157537ejc.432.1643910660036; Thu, 03 Feb 2022 09:51:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643910660; cv=none; d=google.com; s=arc-20160816; b=iQbMeBGO7ZbCE6XoxeVC9nS7BjbApEovNBi8pNGX0bUshE6mtBBQqORBOuQz8vxVZw srAZ3CsQ8+bFeT+j2Gulpyjkf/S0yAHDrkYTUOXG2A6Q16P6vV7KQMgeTv0DEny9F6BR vnPWB5orMVkTdExnnzG08jq0O9RR1j0bS1zo1K8cv1ZA4tVXN+QRNdrYveJhPRrrqX0X PH8KE+ztJet+WM1SM9mARUPYaVnJey5sZrlNC46C6sMAUvHaZI9wFDSaTRkteYA1sw/Q XEXFqSqnAzdubAM9GdehfEoUFPOT66yjAOaRP6fGl/i56cKTpdobeZ9TDmO/yEMQjRnP ZnDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=vzO0p5w5j7FZ4ViC/C4AbqNMVeUQHoVdH0umaEKhaX8=; b=jEPdFDn3M3acTwqGY4HfMhG0B36cFyyAsyQCpiEdysUju76s4IaSQBu5eoZxSgDgwN P7AbBSRF07cKjkrOex3tgzpRMAcYE1L/yTprOy8xXtwQWzzUAH3M1V7lMqecRBidcXla KnnojdF70s4tqYPk0ziLhlcXdVM3zSp3BwYVRKI/otonub7WUpAB/gfBvn6ICXXcUAUz dqjS09RBvwbh/0Prx0AgVHP2+wnQnNlqiIfavEMhBAPM+EH72ylB1pQjeRl5m6hYqKLw gTL6NT1FdMAEJdOJKuhBFeo0FrTdoJJLNv4iiHnQLnZPuyQSwRhZHwadMECQ/bT999Gf 23Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=KLgBxHkf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht13si14284941ejc.850.2022.02.03.09.50.33; Thu, 03 Feb 2022 09:50:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=KLgBxHkf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236683AbiBBNI5 (ORCPT + 99 others); Wed, 2 Feb 2022 08:08:57 -0500 Received: from mail.efficios.com ([167.114.26.124]:55572 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbiBBNI4 (ORCPT ); Wed, 2 Feb 2022 08:08:56 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 1647B34ECF1; Wed, 2 Feb 2022 08:08:56 -0500 (EST) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iTcKd-Q8oOys; Wed, 2 Feb 2022 08:08:55 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 9A13334ECF0; Wed, 2 Feb 2022 08:08:55 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 9A13334ECF0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1643807335; bh=vzO0p5w5j7FZ4ViC/C4AbqNMVeUQHoVdH0umaEKhaX8=; h=Date:From:To:Message-ID:MIME-Version; b=KLgBxHkf93QCuZ3WY8v/zAlE1UWPlw3hnI4czYXnJxuEEBSd5a2Haw2+OQWFkuz8b Z34IyD5fi3wkpzf9sa264PdCaWwo7L44IFC+QtUHFJPFMaQM/dhr76D+5z/gO/UolN qQIXZituMAETOD9Dbkp3RFbca0FP6PtRDehTDfYmvbybfmxGzJ9Cyv8/sdi9fREjef Dv2UvYQ7png3U3WLXRPr1FHphItE/4cJA3Jf01SD+SC+bytkWOMbk9P8Rw61wgpAcR FRcm+d+VsoJsV6CYMjEiO6BZ43FKVKXuvt7dUkGbV7OPWq57wF24n8w1FyBuFs1yhZ 9a99UaKcR/jCQ== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id GwcRLFcMm8Lg; Wed, 2 Feb 2022 08:08:55 -0500 (EST) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 7CEBE34EEEE; Wed, 2 Feb 2022 08:08:55 -0500 (EST) Date: Wed, 2 Feb 2022 08:08:55 -0500 (EST) From: Mathieu Desnoyers To: Florian Weimer Cc: Chris Kennelly , Paul Turner , Peter Oskolkov , libc-alpha , linux-kernel , Peter Zijlstra Message-ID: <770517862.27112.1643807335312.JavaMail.zimbra@efficios.com> In-Reply-To: <1375227765.27051.1643801804042.JavaMail.zimbra@efficios.com> References: <432231420.24682.1643727496135.JavaMail.zimbra@efficios.com> <87mtja1fuz.fsf@oldenburg.str.redhat.com> <875ypx1x0d.fsf@oldenburg.str.redhat.com> <1375227765.27051.1643801804042.JavaMail.zimbra@efficios.com> Subject: Re: Aligning tcmalloc with glibc 2.35 rseq ABI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_4203 (ZimbraWebClient - FF96 (Linux)/8.8.15_GA_4203) Thread-Topic: Aligning tcmalloc with glibc 2.35 rseq ABI Thread-Index: bfYiCaJUUsTdq41BtJE3Fb9JJIH1YGMmnFBS Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Feb 2, 2022, at 6:36 AM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote: > ----- On Feb 2, 2022, at 3:41 AM, Florian Weimer fweimer@redhat.com wrote: > >> * Florian Weimer: >> >>> * Chris Kennelly: >>> >>>> Thanks for the heads up. >>>> >>>> I did have a question about whether the new protocol would introduce >>>> an extra memory reference while initializing a critical section. >>>> >>>> * With initial-exec TLS, I can directly reference __rseq_abi. >>>> * With the new ABI, I might need to ask glibc for the address of the >>>> registered rseq structure in its thread data. >>> >>> You can write __rseq_offset to a static/hidden variable in an ELF >>> constructor, and then use pretty much the same assembler sequences as >>> for initial-exec TLS on most architectures. >> >> And now I'm kind of worried that we should be using ptrdiff_t for >> __rseq_offset because that's what the initial-exec relocations use. 8-/ > > I suspect the underlying question here is: how likely is it that a libc > requires an offset of more than 2GB either way from the thread pointer > to allocate its rseq thread area on a 64-bit architecture ? More to the point: is ptrdiff_t the correct type here ? I think so. Do we want to revert the ABI and wait another 6 months before we bring back rseq into glibc just for this ? I'm not sure this limitation justifies it. So if there is a quick way to fix that before the official 2.35 release, I'm all for it, otherwise I cannot say that __rseq_offset being an "int" rather than a "ptrdiff_t" will make much real-life difference (unless I'm proven wrong). But we will be stuck with this quirk forever. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com