Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1693454pxf; Fri, 26 Mar 2021 12:35:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf0KqzY7kwHyr+QOViSvViOLZ28aQJfw19kDqT1vJlEnHUGFi5umeVARDAjJMiBXd8uXYL X-Received: by 2002:aa7:d841:: with SMTP id f1mr16910798eds.286.1616787356257; Fri, 26 Mar 2021 12:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616787356; cv=none; d=google.com; s=arc-20160816; b=is8xa7x/U8K/bsd5chGsvOcdfWYYkck5h0mipOFzUoZZjVcfRuzSWlYtlXQuxTxtfh TojJ7yzl+iNeNnuiyX22XHlf5SfCEEiR02oZKJjnfIngaE4PiK/F3n5BeMFozkuoSeYf z9x4hktbhzsr0TnBB+EViV2ZsVfUdwfJlfFjpsYRTKtYMe4d1V4TNSJcAoj5i1pCV5I0 +MpvHPTAS7dhWgpMuFHpMLlkbWNU5wE0LLRRRrJZlphtkB+1UfccaWIqD4VxoEnnrSp8 yOs8RaaK2ro1ISluNn+h2kZQIbRzO8NoGsFla+Tmrr0A4XFGvoEBEheQzmM5qw513tzH DNPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date :references:subject:cc:to:from; bh=xRuTSD+406IV3+ycGQM88GWzfh5w6FVH52TF9YNvPxQ=; b=ddi7BymXq3AaVHZbmGR4fT0W+QqhI5Gwe+iS9iQZPViuNHYwC4TFR0E52uYsxGoroc DMYnB+dhaZsqAKwXT+u/9sFQ7vWci/377IoCcBXgcUpJIW5NNsS6altS/AHhAMKuzrs2 tYQvh001tJVJe4FcrsUs/dLd5UPzebQyE+/usSDG1ZowbLbMWkBWSe6FhgLCed1u1PpI q/cGRHlJhuZpCZeLzKOlAQ+659b/uZ7fhqgGcibiJtuKCFIXUkzL03sUf9AVpORTPBf3 9r3SdrQ/MakzGqL4MZgv6092YeGstkIB1hHZkWQY2sWnomy0vQ/hj6FNqtQU8/IN4Ns2 zDyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si7876784edc.166.2021.03.26.12.35.33; Fri, 26 Mar 2021 12:35:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbhCZTeg (ORCPT + 99 others); Fri, 26 Mar 2021 15:34:36 -0400 Received: from albireo.enyo.de ([37.24.231.21]:54790 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbhCZTec (ORCPT ); Fri, 26 Mar 2021 15:34:32 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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.