Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1401577pxj; Fri, 21 May 2021 13:21:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycBvGY/wh1Wb3A71bW0CNzGvHDCOgy9qhNysTNgjitNGv7W3ID+l7x4Jeb7pjP2geepsRC X-Received: by 2002:a05:6638:3395:: with SMTP id h21mr6865355jav.44.1621628496636; Fri, 21 May 2021 13:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628496; cv=none; d=google.com; s=arc-20160816; b=mK+Zbq/icFwES6sdTqH9v5RfFwvH3MzpQrVLEQRtwzil03HwD8j/06rSUwkyTqE7U8 IHxoGvkGPIzs1B8B9CJLJNrf8fsCVIXmoeLqMKzQTZUjwaWPewAXtALMpOVvVLR8ytjZ m3wA54ClQuzwWMNzyBnvXsP+S+Un7ocvPhpxedqCIf6TGsn+KLEwe2efVGXrRlszBoZ0 /k2xdX6BiSOwf2BVIbmV9BdToq65tubvz2eiCtKWDWZ+PaRp17Jzzw7qDvpkyWTVDuPF D45AP95ei5p0yy+FrWxWuKSZ1BWwnyJ53qj//BhiZO9pUsC3CBxlaal9PZAOTZZpStnl wiEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=fFS4V+laUEHsiKbste7xkg0EuH4cmkgb3wAVYYo6X24=; b=1LIwe6GNzPmjiFOiJUzIMFbqLxF3PUSEj6fmIVjsNkhofw1zq16dKIMjZwJgD/cWAk T8EckvioQu0O5NKW4QlEa3A4PVLzGXO2eGSUsNTtY5ivZ/NtJMBw6fuI0b4bqcVWBKqB cqIUojvRQuClak+I9IWKe4pYdy8GDRd0tRD4YRx57Mm5bobxQmH9D3Ye//eJfn9ejasA rX43kxYJKbryVyAhfmXJtmd6qoNE1lcvJ5YpjjbooCO/wRmjTOYnsPU2QLPHkdgp+Dfs bPUXV7Ce/0+DQ5kYIQL3VyKXHk1sLv+JBRw0cumuBjej3kz+Ck5/xApmerzSi6/AjmjX kVMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BBwI4GBL; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si7930007iog.67.2021.05.21.13.21.23; Fri, 21 May 2021 13:21:36 -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=@redhat.com header.s=mimecast20190719 header.b=BBwI4GBL; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234150AbhEUQUs (ORCPT + 99 others); Fri, 21 May 2021 12:20:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42370 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbhEUQUp (ORCPT ); Fri, 21 May 2021 12:20:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621613961; 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=fFS4V+laUEHsiKbste7xkg0EuH4cmkgb3wAVYYo6X24=; b=BBwI4GBLuCks0zB80XTryi7U7WmQmy543VsKKwJMjTS3FJbtK2pPcqCjZKlRjRBoKbsS+R 9olHBUnOQpp9yePob67raTPAhLtu0tKFMIRlkUHKyoX3gz1iaJiESzUpyQWcXmavvNchgu y1mZol4pt59RXzX0CcNBz4vf+T8XKCg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-qYSbj5MvMNux4HU5wvqCEg-1; Fri, 21 May 2021 12:19:17 -0400 X-MC-Unique: qYSbj5MvMNux4HU5wvqCEg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B8546D4E0; Fri, 21 May 2021 16:19:15 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-228.ams2.redhat.com [10.36.113.228]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9302D5D6DC; Fri, 21 May 2021 16:19:11 +0000 (UTC) From: Florian Weimer To: 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 , Thomas Gleixner , Keno Fischer , Arjan van de Ven , Willy Tarreau Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features 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> Date: Fri, 21 May 2021 18:19:09 +0200 In-Reply-To: <939ec057-3851-d8fb-7b45-993fa07c4cb5@intel.com> (Dave Hansen's message of "Fri, 21 May 2021 09:14:12 -0700") Message-ID: <87r1i06ow2.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Dave Hansen: > On 5/21/21 7:44 AM, Florian Weimer wrote: >> * Dave Hansen via Libc-alpha: >>> Our system calls are *REALLY* fast. We can even do a vsyscall for this >>> if we want to get the overhead down near zero. Userspace can also cache >>> the "I did the prctl()" state in thread-local storage if it wants to >>> avoid the syscall. >> 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. Is there still a chance to bring the hardware and Linux into alignment? Thanks, Florian