From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by sourceware.org (Postfix) with ESMTPS id 8DF883857C56 for ; Fri, 21 May 2021 19:05:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8DF883857C56 From: Thomas Gleixner 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, 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, 21 May 2021 19:05:16 -0000 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