From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 864503858C27 for ; Fri, 26 Mar 2021 19:34:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 864503858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (port=41575 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1lPsDy-00017a-I1; Fri, 26 Mar 2021 19:34:26 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1lPsDy-0007IK-Bb; Fri, 26 Mar 2021 20:34:26 +0100 From: Florian Weimer To: Andy Lutomirski Cc: "H. J. Lu" , X86 ML , LKML , "Bae\, Chang Seok" , "Carlos O'Donell" , Rich Felker , libc-alpha Subject: Re: Why does glibc use AVX-512? References: <87a6qqi064.fsf@mid.deneb.enyo.de> Date: Fri, 26 Mar 2021 20:34:26 +0100 In-Reply-To: (Andy Lutomirski's message of "Fri, 26 Mar 2021 11:14:22 -0700") Message-ID: <87blb5d7zx.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Fri, 26 Mar 2021 19:34:47 -0000 * Andy Lutomirski: >> > AVX-512 cleared, and programs need to explicitly request enablement. >> > This would allow programs to opt into not saving/restoring across >> > signals or to save/restore in buffers supplied when the feature is >> > enabled. >> >> Isn't XSAVEOPT already able to handle that? >> > > Yes, but we need a place to put the data, and we need to acknowledge > that, with the current save-everything-on-signal model, the amount of > time and memory used is essentially unbounded. This isn't great. The size has to have a known upper bound, but the save amount can be dynamic, right? How was the old lazy FPU initialization support for i386 implemented? >> Assuming you can make XSAVEOPT work for you on the kernel side, my >> instincts tell me that we should have markup for RTM, not for AVX-512. >> This way, we could avoid use of the AVX-512 registers and keep using >> VZEROUPPER, without run-time transaction checks, and deal with other >> idiosyncrasies needed for transaction support that users might >> encounter once this feature sees more use. But the VZEROUPPER vs RTM >> issues is currently stuck in some internal process issue on my end (or >> two, come to think of it), which I hope to untangle next month. > > Can you elaborate on the issue? This is the bug: vzeroupper use in AVX2 multiarch string functions cause HTM aborts Unfortunately we have a bug (outside of glibc) that makes me wonder if we can actually roll out RTM transaction checks (or any RTM instruction) on a large scale: x86: Sporadic failures in tst-cpu-features-cpuinfo The dynamic RTM check might trap due to this bug. (We have a bit more information about the nature of the bug, currently missing from Bugzilla.) I'm also worried that the new dynamic RTM check in the string functions has a performance impact. Due to its nature, it will be enabled for every program once running on RTM-capable hardware, not just those that actually use RTM.