Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2495024pxj; Mon, 17 May 2021 02:59:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGvPMQZ6dvm1UL+qFhGWX4AlrwVK2nJAXUpVwDgSrIKlTRS20wik/KHjMUFu7+idyllm9k X-Received: by 2002:a50:c44f:: with SMTP id w15mr72067945edf.79.1621245595676; Mon, 17 May 2021 02:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621245595; cv=none; d=google.com; s=arc-20160816; b=hzcX7ZnYyQylZh7wrqmE72Nx3QApDavV3VP/g+Zy4PtPOV3eCChcgpLbA5VjMfzsyX 83Fu6/CD6IBKEZ5Npm1IeIWzUwDoc2ittart5aV+mSKJJ6swLkLdAhbW+hiXpz4DMn9T OmhzaTRRggvEhIpVs1ULLSTfDpPoMfBrmj5OZ4V6Tf8BQla1hmx/Z54p2KoGh7tiZUC8 LE77c7M4OoGKU/K8TPV+bKoyneEOfgOiXBJDapmWl/KD0T/86myOeLI2k16LH7bLRCLD Js7YiMR/wdC/h+cK0boHV7wuatvFNR+5WNBOCiVP8iQLXlultDquPeGrafqgWz7xoqh0 5xGA== 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=C+hYtbQeVxoHt/6+9B9mxwjiL2Lj7LwbtAeSgLEv7zA=; b=oTSB0UREtqq+Hk+OaAzVqoDd+pozIo9IGl/CqEF0PYsQnWNGhAEGr66nEcfLgiOBgU LQcJz5JTlcKzAir9kVeD6Kt1flDkQWSYDBvgskGq0Ruckfr8frsp631BQwXFUtpQcllq M+K3lcE8hxMajBRbUSfWT0oyMkXDHa8X/NNAgWtTU2+AFPjHT33HfP1mlKz76KBnqc0p /FQfm9FDoww5aF48rMIf6fTB2x8SNKNVgBLG1Z+1xI2+MhtFGVBFNpynCaQuwjhsIm+3 rTh0StgVshJx+L3ULhZvCC/pPdYaAbV1FlQCR9i9lkTXdQV0J/guh4H25BwQXM8x2dcz 1Bsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HPzZH9GB; 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 cq14si15520714edb.242.2021.05.17.02.59.32; Mon, 17 May 2021 02:59:55 -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=HPzZH9GB; 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 S236280AbhEQJ6c (ORCPT + 99 others); Mon, 17 May 2021 05:58:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50020 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236375AbhEQJ6E (ORCPT ); Mon, 17 May 2021 05:58:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621245407; 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=C+hYtbQeVxoHt/6+9B9mxwjiL2Lj7LwbtAeSgLEv7zA=; b=HPzZH9GBOKg427dR3pme72oPFIAt1F6jpy2zgNd6Pvd8iE9MMCnlJjjtRFc5hdkJcASk2m kdHPbth4NcrIeUmVyQtAP9VVM39ogw4WehC0xEAK3Ak7vkjtcshbi/l3Rj6yW2JX93XdrF 91BcYEk4JMw4NuyfP6ACznA4r2718Ss= 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-289-D9EuS6n9N9KmTukwNhIbLw-1; Mon, 17 May 2021 05:56:44 -0400 X-MC-Unique: D9EuS6n9N9KmTukwNhIbLw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 70AAB1B18BFA; Mon, 17 May 2021 09:56:33 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-137.ams2.redhat.com [10.36.112.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 543E56E70E; Mon, 17 May 2021 09:56:29 +0000 (UTC) From: Florian Weimer To: Thomas Gleixner Cc: Len Brown , Borislav Petkov , Willy Tarreau , Andy Lutomirski , "Bae, Chang Seok" , Dave Hansen , X86 ML , LKML , linux-api@vger.kernel.org, "libc-alpha@sourceware.org" , Rich Felker , Kyle Huey , Keno Fischer , Arjan van de Ven 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> Date: Mon, 17 May 2021 11:56:27 +0200 In-Reply-To: <874kf11yoz.ffs@nanos.tec.linutronix.de> (Thomas Gleixner's message of "Mon, 17 May 2021 11:45:00 +0200") Message-ID: <87pmxpk7jo.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.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Thomas Gleixner: > Having a proper interface (syscall, prctl) which user space can use to > ask for permission and allocation of the necessary buffer(s) is clearly > avoiding the downsides and provides the necessary mechanisms for proper > control and failure handling. > > It's not the end of the world if something which wants to utilize this > has do issue a syscall during detection. It does not matter whether > that's a library or just the application code itself. > > That's a one off operation and every involved entity can cache the > result in TLS. I'm not sure if it's a good idea to have each AMX consumer to set up its own TLS cache. How expensive is checking XCR0 via XGETBV instead on the AMX path? Then AMX can be enabled on the thread via a system call. It also allows disabling of AMX. It would also need an AT_HWCAP2 feature flag telling user space that AMX support is available after that system call (switching on AMX to check whether AMX paths should enabled later seems potentially wasteful if the AMX paths are never taken after all). Thanks, Florian