Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1405647pxj; Fri, 21 May 2021 13:28:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziWhQFySxK7Z6N/UfVX7drt2Ec7QmRBJeNFz5sBjl3Z/pp3S2pJtoLlf3rHAoTdTfHKF7i X-Received: by 2002:a05:6e02:eb0:: with SMTP id u16mr645431ilj.263.1621628904349; Fri, 21 May 2021 13:28:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628904; cv=none; d=google.com; s=arc-20160816; b=J8Tc+RyXqutDRROf1OOeC8ZUCer7XKdtErCfgKPtg4sHb2FMxC18U4EQzqhcStFq+c tJUu9VXJhsT1d/8ZhLIj6rDXgXeJDhuWIdRiK5+Uu3TLqzC5dtKKScpl8/Vl0rtDZjF/ napPxv7t17SHKJMYRWKDBWmVazzuA+nWJwlQTv7jmNy/vp8MGuNJwhplUQdZBkwLw6NK x59gJEWFovUNlQSvjo/kphabCl/g9RouJ3zU4jzmteVsScy2bsXOwnzR2l/JP22CDXrk Yh9/vM74kv9S3lbjOpGCzPJYI4kAfZ+7WJrSiZGPJA0yN/UdM4+tPgNyzeZdMzu+B6Ew dmBA== 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:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=SR6OQKV549q4JEmHXLaUA2oYN7XUebJWxPZZsjcwpXA=; b=abfeQrrk72V2dtXKSPBW5RWFT0YEpUpWoxFV8L0eDkyxEbvS0c1OqNIS46DevKX+I+ mdmTPowSG3hlsx2yfzhEuA5cZVgwzqRLjC+toTGMmuaUG0jgdOc/fgi4zecHDAkY+WlX 1PEFpP08yvUj2umEJVC/4FIFEyNzSpAiVzUcFiECE2lnDO0GbR1/r1yzKIbB9yAQAvZi ElLB9oq8voV2eaavR76m5Mqzd4RWx3YjjRU0CNMED2r3ZFodPO/DOEIpSYoNZdPy7Pol AoJp21Txe41XaSAEH2LdY3ZH92LgQ1oMiDcY/mrOBpKGIT0qnTxxr5aOQGwPzJgtCUL2 Ci4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Zv3ZMHsz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si7351940ioh.58.2021.05.21.13.28.11; Fri, 21 May 2021 13:28:24 -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=@linutronix.de header.s=2020 header.b=Zv3ZMHsz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237281AbhEUTGk (ORCPT + 99 others); Fri, 21 May 2021 15:06:40 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:55792 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237725AbhEUTGi (ORCPT ); Fri, 21 May 2021 15:06:38 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1621623913; h=from:from:reply-to:subject:subject: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=SR6OQKV549q4JEmHXLaUA2oYN7XUebJWxPZZsjcwpXA=; b=Zv3ZMHsz/WqA2OZplcBOcXMjOU/yIE3KJx2qdGtwi23yV0Kv8Z05RG84DqldU3qTQsVscs wWviYdHkkDT2Gel7in/axP06urZjAtnqXmbHUJ4kgYfHtL7ThpT4G37dGJeXSTGpkMiG5G fUk1j9Jxc5SoaukIUVtfUQIvSDPoCMycxdIYXYUpfJxQUZC3HnDWrstt5DO96lPsmPzdrY d46LcFWDyNuOuCfJ6/fb5glFNG7YMIbP4bwwFE6tzJ2cc38+cX0Mci3Iye661ehz4B0CKt cxm8RR23b/vwDYFv+88Q4HewZYvABF4XLue/5SYTH8IO1m9oUjOcD+4npJa2gw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1621623913; h=from:from:reply-to:subject:subject: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=SR6OQKV549q4JEmHXLaUA2oYN7XUebJWxPZZsjcwpXA=; b=KIQGYLB6834C1i8fuxGQgYAzy4USl9ZUZIDx704KQ4rHjuVYaBZxU70nTLv/D+Yu6NTMVY fu7haF6Uk4uH0pBw== To: Florian Weimer , Dave Hansen Cc: Dave Hansen via Libc-alpha , Len Brown , Rich Felker , Linux API , "Bae\, Chang Seok" , X86 ML , LKML , Kyle Huey , Borislav Petkov , Andy Lutomirski , Keno Fischer , Arjan van de Ven , Willy Tarreau Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features In-Reply-To: <87r1i06ow2.fsf@oldenburg.str.redhat.com> References: <20210415044258.GA6318@zn.tnic> <20210415052938.GA2325@1wt.eu> <20210415054713.GB6318@zn.tnic> <20210419141454.GE9093@zn.tnic> <20210419191539.GH9093@zn.tnic> <20210419215809.GJ9093@zn.tnic> <874kf11yoz.ffs@nanos.tec.linutronix.de> <87k0ntazyn.ffs@nanos.tec.linutronix.de> <37833625-3e6b-5d93-cc4d-26164d06a0c6@intel.com> <9c8138eb-3956-e897-ed4e-426bf6663c11@intel.com> <87pmxk87th.fsf@oldenburg.str.redhat.com> <939ec057-3851-d8fb-7b45-993fa07c4cb5@intel.com> <87r1i06ow2.fsf@oldenburg.str.redhat.com> Date: Fri, 21 May 2021 21:05:12 +0200 Message-ID: <87mtsnaown.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21 2021 at 18:19, Florian Weimer wrote: > * Dave Hansen: >> On 5/21/21 7:44 AM, Florian Weimer wrote: >>> Why can't userspace look at XCR0 to make the decision? >> >> The thing we're trying to avoid is a #NM exception from XFD (the new >> first-use detection feature) that occurs on the first use of AMX. >> XCR0 will have XCR0[AMX]=1, even if XFD is "armed" and ready to >> generate the #NM. > > I see. So essentially the hardware wants to offer transparent > initialize-on-use, but Linux does not seem to want to implement it this > way. The hardware offers an exception which can be used to implement that, but the hardware does not dictate that usage. If we'd go that way we lost any control over that resource and I can demonstrate with AVX512 today what kind of consequences that has with mixed criticality realtime workloads. The only solution we have today is to disable AVX512 completely, which sucks because restricted usage can be benefitial for some of the computations. The problem is that the approach of user space in general seems to be blindly_select_max(AVX). I've seen that in quite some places. With AMX (and the stuff coming next) we have the chance to do proper resource control and it would be outright stupid not to take that opportunity. Thanks, tglx