Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1414648pxb; Wed, 2 Feb 2022 04:36:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJy+t3uGIQst4Yk6JMaXTT/KsSUbWPJZzucE9czTlhkLnVBhP0VinCPMlEC5CTvXYCAGTrKp X-Received: by 2002:a63:2bc9:: with SMTP id r192mr14109519pgr.298.1643805375472; Wed, 02 Feb 2022 04:36:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643805375; cv=none; d=google.com; s=arc-20160816; b=bjcq09WtNGdsWiJz5YPucezI5KWTNF8UXkFzsbdbicN3SH+W9YFXjgX5JjFWwhEl22 ahm30JCxT80WX9Rgy/90kTkSLYdOa89Sm7IQu+X7rK8+NOotbwawZBV+lMiTnoLW6jHS oOkKZblWr+HbLK70T/XulYXSz15ghsFWCEY1kMhtwkh0mH0f5q3EUtSEr+wmd4CWo4C2 YCw9y3GrIr3Mh5BpJFgu0IoVB2JGZygp9wRNrK1nItzWsoCuIT+fx78N64JCO7zUjgcB eZVHg8zlj1vsc6VVe0Ubn09kSlur2/Q0iVdx5uhTAENJnfIbmeM9wW3aKc0s14FK1xNh Vb2Q== 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=rxS2P9dAZNsnpQt9S56KVrnhmEyCUB0/0QQLFiwcG4M=; b=KBfutY4jn47Pv85mXINhv0Ie1uknMExklwN6JKzRwkdaXPDYja+ZqXkQN7dSZZIJYM PogdOBm4BusrlwvRGD4Oh+HoA+VRcqXBy8v0KvoN690HarlW/GLEuLGXAcCI+3SUPXYD KY12TQvogAIcUIVCeB+h5d51p7LcHVKnvjzgKJik6ngnAzBhReaoQKUIFJlVwjYbpdoh azEi9FBRuCFa+ol937EhcGKRUOuiftsGyZz2Frvbyfh3LJoCG0FsW8LjEvJkk1OFOie5 tIu8CoyEDvRztJXB581Iopji4StRGBx5SZapHsu+DoDnauX+DESi2CDLYJqnGUghiaJT pPhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=fU+aRFid; 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 h191si18701601pgc.628.2022.02.02.04.36.02; Wed, 02 Feb 2022 04:36:15 -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=fU+aRFid; 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 S234657AbiBBLgs (ORCPT + 99 others); Wed, 2 Feb 2022 06:36:48 -0500 Received: from mail.efficios.com ([167.114.26.124]:54762 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241292AbiBBLgp (ORCPT ); Wed, 2 Feb 2022 06:36:45 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id B785434EB03; Wed, 2 Feb 2022 06:36:44 -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 BcjIfy6EbqW3; Wed, 2 Feb 2022 06:36:44 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 3A12B34E92B; Wed, 2 Feb 2022 06:36:44 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 3A12B34E92B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1643801804; bh=rxS2P9dAZNsnpQt9S56KVrnhmEyCUB0/0QQLFiwcG4M=; h=Date:From:To:Message-ID:MIME-Version; b=fU+aRFidh/q56dL5ZhXWz9i50Q3f6eIBNxRcr3WK9Jv5AmwjHV9KdcZvACpBUgDQ6 ROejxUBkXZnK1hLCtXcFkwFmPaQtAAVy1jegehFEA3PfyqATvXss380XGsiO1pGP+z JsOj5JNv0TOibk/uJUazbrLVf8g55CwQaRWGitHXMt5DKcGDm5clEUsf76Y6G4MwkD bV13tgHVBhJeaWlUiOVitS6ZSYZLZWbGa5rnWuuZVZDinU2luTsOW8VtBHJm9wkl+1 3SqzkIiOaccx1Hd0eRmbnEm5A5OwFmGHgZ2fVn1K5JNNX2+oTHrb6jo88fg1x3FclO HGc2FH+NLd5CQ== 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 2orB1KVM8yug; Wed, 2 Feb 2022 06:36:44 -0500 (EST) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 2BAFA34E9AD; Wed, 2 Feb 2022 06:36:44 -0500 (EST) Date: Wed, 2 Feb 2022 06:36:44 -0500 (EST) From: Mathieu Desnoyers To: Florian Weimer Cc: Chris Kennelly , Paul Turner , Peter Oskolkov , libc-alpha , linux-kernel , Peter Zijlstra Message-ID: <1375227765.27051.1643801804042.JavaMail.zimbra@efficios.com> In-Reply-To: <875ypx1x0d.fsf@oldenburg.str.redhat.com> References: <432231420.24682.1643727496135.JavaMail.zimbra@efficios.com> <87mtja1fuz.fsf@oldenburg.str.redhat.com> <875ypx1x0d.fsf@oldenburg.str.redhat.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: bfYiCaJUUsTdq41BtJE3Fb9JJIH1YA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- 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 ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com