Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1472218pxb; Wed, 2 Feb 2022 05:50:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJytDWg5Yh2cQro5TT5caWpYLL8Bp0u255Hrz12Ko68l70cOtz9zOR9b1ActbiRwZrnEowgX X-Received: by 2002:a63:8a42:: with SMTP id y63mr24241989pgd.413.1643809858031; Wed, 02 Feb 2022 05:50:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643809858; cv=none; d=google.com; s=arc-20160816; b=RtKt0oNs33EjnlSDzzilD2E+5EQc/4Dw+Kg/qIzgUMvLy5EZ3Q52aL+Sck1zu5yZOP AUgeXWqcEQcRtJoqp2xCBf/n1M3PC/oor7tsxXcmm1QS4G7tvmeBorYBtuR1TdI/wf1F db7kOMnFeG0iL1G80xjAqLZZ5YhkYUZA0BOOmdAY1WTWJ9rMn6Swy8MMfeFy95420HwZ MpTo4o/qzlCMzrmQSt8bUWJSAPdiJxAR3HAhYUZyvNPbT/0VLbQ85xmOmXYzAyRXC4c1 lc2TAGXw0mEyIxSRGtkFMg1gZVNe//Hu526nCXa/EyYKfGRa6cVuPNhT+e6+KdZVQ9um +2UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=O6G+WcjnWmWZaQhRnWSHvUr/fYsky3pk6F/savisetw=; b=t4CmRmTkF50GvuH2c8UzIIy2l/vdQiDCyKSE5XkUoK5U+AmS0jAC7Mo4VN2QFJ/ESz 5cdk3OzGhNpnMWVRH3QcAvZJ2dC/yyKRuq66/AXjVWLZJ4c5JEMvMsuEiQUwcNd32K+Y y7ppno5H97ag1iYY/dBV8LHFILZHkYsIYu9sCJwAgXnRyPXtTRXfBPp7iqO7GgEcCfpH 5666j1zwQ6YUfAqaEGP8eZDcTjyxj1JEV4TgDuAc2St2lUELp1hG0wImjwJY0bvEqCnx UBeaLV1Mf6TipZ6q4Czrj5stjZYjfvQCq7Y7A4G3nW5AJMN757bhVXKLI134a+Rw0Wgq lvCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=S6YIuMY5; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20si5258200pjp.15.2022.02.02.05.50.46; Wed, 02 Feb 2022 05:50:58 -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=@google.com header.s=20210112 header.b=S6YIuMY5; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239184AbiBAUdd (ORCPT + 99 others); Tue, 1 Feb 2022 15:33:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238396AbiBAUd1 (ORCPT ); Tue, 1 Feb 2022 15:33:27 -0500 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99212C06173B for ; Tue, 1 Feb 2022 12:33:26 -0800 (PST) Received: by mail-il1-x12f.google.com with SMTP id y17so15327422ilm.1 for ; Tue, 01 Feb 2022 12:33:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O6G+WcjnWmWZaQhRnWSHvUr/fYsky3pk6F/savisetw=; b=S6YIuMY5Fm+oaiJY6rmrKKmVpoAYSiLE5Lme8sQjjSbjQd8T6WxRJ2kprv62ZTZQX8 FD/7SdvBXJvC6ab4i/9fZL+PW+Smfo2jcOMolENHyjl5Mc7NAIZWa1SrGLoMFrZuROr4 isR50HKiwMKGNoKKH3nZ8ywESgfVQ3B03ZivzYh5syhf5305yZ1/9Gb7KvV30i3hhXD8 F8+20ed5Y9cwN8jjAc4pcmuKRSPXos9l2BCaSdX3yNiL7ipjVkjCFV2Fdp5FIqVJUHdK j6rfWoVjbKBJp4d+0zrsnj1/Bg+d+80dv8NYAbuLv4/CUjCmiulGE6VqBILiy6Q402Eu 9Kfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O6G+WcjnWmWZaQhRnWSHvUr/fYsky3pk6F/savisetw=; b=F3p5nkgQs9ZHfYdpbq1hheR0pcs6EPqxbuVIkrimWxoIGiZkHs/wyhxFuDF9/ZhXU6 DdAEQkuBSG3byeDf2OVmpw2cp8uHOSLrQ96nIVYf8DvQb6keT1TINQDD+aju122sEXo4 wTx7dB7yzuebsfnSjyxjJj9Aut450VEPC+327V5N8Rnl6Z7Fio6QIUnwJJxx+8yz7PX4 hDIsX8BvSe3tPM1GrLu0SSy1Nerk+k/5STDBAiM+HZCFuKWLwejLldeksZ7xekWcoVfl vLM3AoqIbRERfaDSa8tibWQINm7Phv2eIo422jX2KkzYcMwIglCqZCv0x03L7D5dshUW BdWQ== X-Gm-Message-State: AOAM532WGsRgF9XQp0xPWnNZ/iJ7DzJI3jbWeGXnCQOjtGgZ1yxMTG0Z 5gj6d67E0a6dtqq+vY/giQC9+4Czyupae6b5d9ZEAg== X-Received: by 2002:a05:6e02:1708:: with SMTP id u8mr8462691ill.319.1643747605818; Tue, 01 Feb 2022 12:33:25 -0800 (PST) MIME-Version: 1.0 References: <432231420.24682.1643727496135.JavaMail.zimbra@efficios.com> In-Reply-To: <432231420.24682.1643727496135.JavaMail.zimbra@efficios.com> From: Chris Kennelly Date: Tue, 1 Feb 2022 15:33:15 -0500 Message-ID: Subject: Re: Aligning tcmalloc with glibc 2.35 rseq ABI To: Mathieu Desnoyers Cc: Paul Turner , Peter Oskolkov , Florian Weimer , libc-alpha , linux-kernel , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. I saw https://lkml.org/lkml/2022/1/24/859 mention using %gs, but it also mentions consulting "rseq_offset" in the address calculation. Is rseq_offset something I can resolve to a constant or would I need to access a global for it, or does glibc take care of initializing %gs to the address of the structure registered with the kernel (for the current thread)? Thanks, Chris On Tue, Feb 1, 2022 at 9:58 AM Mathieu Desnoyers wrote: > > Hi Chris, > > You will probably want to have a look at the userspace rseq ABI exposed by glibc 2.35 to ensure > tcmalloc becomes compatible with it. > > If it helps, you can have a look at how I modified librseq to play nicely with glibc 2.35: > > https://git.kernel.org/pub/scm/libs/librseq/librseq.git/ > > Most relevant bits: > > https://git.kernel.org/pub/scm/libs/librseq/librseq.git/tree/src/rseq.c#n108 > > Thanks, > > Mathieu > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com