Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1640148pxf; Fri, 26 Mar 2021 11:21:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyElTMCyov00ci1Nl+3rVd7D7A1LVTK4ZyzucWMsEW2rOH/gIdR+8eeVyl0sIRl1f8GNdbH X-Received: by 2002:a05:6402:1649:: with SMTP id s9mr16504379edx.177.1616782881456; Fri, 26 Mar 2021 11:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616782881; cv=none; d=google.com; s=arc-20160816; b=hN8li0EVgLCZoN6vF2wxx/V+RpxSPw1gPCJJl6DvNt+cbn1UqCdvUjKFO/Q3rVKCZy jyZiz+HfjGZW858BCzM+YgEBa1AeURoXvqnUuiDkPvQOl4T5Cip4gE3khGLbbkDy3JuL GtnNli+TmosRiyuNOBxna+AbblDUM1LunKAi+aCTH5W//HRhqgYIBuxaHSYtaLiXda30 cWEF9+srxVZeVHUacUno1/e2dOBqKAtNgkfLKHl26qN63qlQ5kHzWdgY6q9/TRW8nPVl Tc8kQqUT5kdBVLXsTtOAFNufNpsttTGpCP5Hz06XBSO/ggDP6KetS439Pl35Up6qgJ8y 2ENA== 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=ZX3Z7n3zdlyt55+hmk7RGnR3YJWIu6TkYgliNLXg/DQ=; b=Lr5RvZtuaIT07K+IKKNUzmIUxUziUc5owO5QOLbD4OzoqsTory0uCqDBydaUt2GKlg 3OnLH4142XmFtxX0VDFw9E6b45fRVPhZDj+lKu56u98Cmdm9AY3k1Gt0sGEFRyBUtyBX /xwQqRXV9r7k5pysgUJXVgq52lZOxrwWFWCxbX9LdaYJZJztTxMByWhhIohwchXXvedF RmKnbfZ+GXliBhVyjHIn31FT+kNyuHVg2bt/L3/UtIspOvrfIDf7Y5PNDLsUQXZVFAMj rL4MbS6uge7rzi40t7d3vB/XT9mpgZfjcOjSfzeBGVJAbN+YlWL0hwAK3ddOokI76XX6 /o0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PlB9MzCO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si6946316ejx.30.2021.03.26.11.20.59; Fri, 26 Mar 2021 11:21:21 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PlB9MzCO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230114AbhCZSSC (ORCPT + 99 others); Fri, 26 Mar 2021 14:18:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:33042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbhCZSRa (ORCPT ); Fri, 26 Mar 2021 14:17:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E1C2361A2B for ; Fri, 26 Mar 2021 18:17:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616782649; bh=74+sI+TN377sFRw/Vl7DD4IVQL53nPf89fjVzunqH1c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PlB9MzCO85lYTxdg0SL+xGsR7cSM1bKM3ptczKnqT3gwbp8YFItcVd/sM9gYNc75O XC4YeSf5WYkeeoolzW5uZocoVuelf7bmU4HISNOs8Axgtcz8CMbABj31LnRwXKYkd7 OAT6yoUt0LrkNBfgvs30hNfaOF8sowJ0Q+H6cHCpJnVgERh4aftKM/V5jaMeiuyWvO CvLoCCRsi1RpprA+hGFwPnN8f53bZewzDEAXMO/Sl9eDXHDHCUQlmRaqoY7DE4tG8T lJqxWwexDe+mge98O0ff5wxtpl0jQ5fa3l2PviCVIBS7dDY/yOSwb7fhqZahadK+/u Jg3Nu264lbuzw== Received: by mail-ej1-f48.google.com with SMTP id u5so9779629ejn.8 for ; Fri, 26 Mar 2021 11:17:28 -0700 (PDT) X-Gm-Message-State: AOAM531N5mCm8qFe52rOhTPwPh5ar4IOOCfBnkLwzQOsb76lMuAdbgnP rP77NmzeRrT+9lv6BVafrUd4YygUVi06zF+ISMiILA== X-Received: by 2002:a17:907:2809:: with SMTP id eb9mr16352179ejc.204.1616782647423; Fri, 26 Mar 2021 11:17:27 -0700 (PDT) MIME-Version: 1.0 References: <20210326100620.GA25229@zn.tnic> In-Reply-To: <20210326100620.GA25229@zn.tnic> From: Andy Lutomirski Date: Fri, 26 Mar 2021 11:17:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Why does glibc use AVX-512? To: Borislav Petkov Cc: Andy Lutomirski , libc-alpha , "H. J. Lu" , X86 ML , LKML , "Bae, Chang Seok" , Florian Weimer , "Carlos O'Donell" , Rich Felker Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 26, 2021 at 3:08 AM Borislav Petkov wrote: > > On Thu, Mar 25, 2021 at 09:38:24PM -0700, Andy Lutomirski wrote: > > I think we should seriously consider solutions in which, for new > > tasks, XCR0 has new giant features (e.g. AMX) and possibly even > > AVX-512 cleared, and programs need to explicitly request enablement. > > I totally agree with making this depend on an explicit user request, > but... > > > This would allow programs to opt into not saving/restoring across > > signals or to save/restore in buffers supplied when the feature is > > enabled. This has all kinds of pros and cons, and I'm not sure it's a > > great idea. But, in the absence of some change to the ABI, the > > default outcome is that, on AMX-enabled kernels on AMX-enabled > > hardware, the signal frame will be more than 8kB, and this will affect > > *every* signal regardless of whether AMX is in use. > > ... what's stopping the library from issuing that new ABI call before it > starts the app and get automatically enabled > for everything by default? > > And then we'll get the lazy FPU thing all over again. At the end of the day, it's not the kernel's job to make userspace be sane or to make users or programmers make the right decisions. But it is our job to make sure that it's even possible to make the system work well, and we are responsible for making sure that old binaries continue to work, preferably well, on new kernels and new hardware.