From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 6207C3857C53 for ; Thu, 22 Jul 2021 16:01:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6207C3857C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 84A5D1FF1F; Thu, 22 Jul 2021 16:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1626969670; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1xPy0TNPfyl/3V1vS+JTOUVaboI57/4pFaoCPhONimo=; b=Zdd246pLHgme5nbE7/r088JGYZwyCEUBtVyto3jNMdTEneL8iQr26bXIx0orXb0qHIkOzc sLmmsCikjHbcigUZhcqE7muBm4v+56vzmqvQNYv6QE1RCB2lBUUDEXk7OQkbLjqpTHnidI JuNor3a9FPDgcbU3WI/BIm0r0xhG4hU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1626969670; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1xPy0TNPfyl/3V1vS+JTOUVaboI57/4pFaoCPhONimo=; b=TmKkSnbCtp+BbYDvOGsWmfhTgLP5lBhMOtRNM8exkbUiNt9RpD7wwN/nUQ0Poju20qYyO9 afj/YOzuh96CKrAw== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 66B58A7C41; Thu, 22 Jul 2021 16:01:10 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id 5CEF665E3; Thu, 22 Jul 2021 16:01:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id 5BA0E6562; Thu, 22 Jul 2021 16:01:10 +0000 (UTC) Date: Thu, 22 Jul 2021 16:01:10 +0000 (UTC) From: Michael Matz To: Richard Biener cc: Florian Weimer , GCC Development , GNU C Library , qemu-devel@nongnu.org Subject: Re: Disabling TLS address caching to help QEMU on GNU/Linux In-Reply-To: Message-ID: References: <87im15qbp3.fsf@oldenburg.str.redhat.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:01:16 -0000 Hello, On Thu, 22 Jul 2021, Richard Biener via Gcc wrote: > But how does TLS usage transfer between threads? On the gimple level > the TLS pointer is not visible and thus we'd happily CSE its address: Yes. All take-address operations then need to be encoded explicitely with a non-CSE-able internal function (or so): &x --> __ifn_get_tls_addr(&x); (&x in the argument just so that it's clear that it doesn't access the value at x and to get the current effects of address-taken marking of ADDR_EXPR). (Or of course, ADDR_EXPR could be taken as unstable when applied to TLS decls). Quite a big hammer IMHO. Ciao, Michael.