From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by sourceware.org (Postfix) with ESMTPS id D6F863857C44 for ; Fri, 26 Mar 2021 19:47:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D6F863857C44 Received: by mail.kernel.org (Postfix) with ESMTPSA id 32740619F2 for ; Fri, 26 Mar 2021 19:47:55 +0000 (UTC) Received: by mail-ed1-f43.google.com with SMTP id l18so7600706edc.9 for ; Fri, 26 Mar 2021 12:47:54 -0700 (PDT) X-Gm-Message-State: AOAM5330Ey4ACHEccqU9jOsKknZ/iLCapUQFLmVXkC8WKhypNiC9czfg R16V1++gIHCEP7BAX3z4R0G8MmC5dwaPs1+K5AZhxw== X-Google-Smtp-Source: ABdhPJz7m/lyPJlaRnXSVlCOG5Tbm9pQ/e4xOvscQ3KDIWjqcXihaVUkLlhMMuTR/eEmzLaOIDvxLC8LPD1rR6tX5uA= X-Received: by 2002:aa7:da98:: with SMTP id q24mr17497772eds.84.1616788073594; Fri, 26 Mar 2021 12:47:53 -0700 (PDT) MIME-Version: 1.0 References: <87a6qqi064.fsf@mid.deneb.enyo.de> <87blb5d7zx.fsf@mid.deneb.enyo.de> In-Reply-To: <87blb5d7zx.fsf@mid.deneb.enyo.de> From: Andy Lutomirski Date: Fri, 26 Mar 2021 12:47:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Why does glibc use AVX-512? To: Florian Weimer Cc: Andy Lutomirski , "H. J. Lu" , X86 ML , LKML , "Bae, Chang Seok" , "Carlos O'Donell" , Rich Felker , libc-alpha Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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:48:00 -0000 On Fri, Mar 26, 2021 at 12:34 PM Florian Weimer wrote: > > * 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 > It's worth noting that recent microcode updates have make RTM considerably less likely to actually work on many parts. It's possible you should just disable it. :(