Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1406066pxj; Fri, 21 May 2021 13:29:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSZWMCc5KE48b7HIu/vTLskAcMfY7VZNw7XnKfZxez9vuHRIJHYH9Nsp9EQTwI69gKMPuP X-Received: by 2002:a92:cf0f:: with SMTP id c15mr665065ilo.288.1621628951920; Fri, 21 May 2021 13:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628951; cv=none; d=google.com; s=arc-20160816; b=aty4FOE2T7ZkY4fhhiWAvc8GotjYb2coZk7/99Sc6TRHHJLKqzemaZROH5AjqGIYvx gRcKpmQqChsgb5d/7WuqJqpXOw9xGBlAUmsgK0zrmzU4s7uJvOJBOX37Eh8yVCPO4Jrs IkVAHv34HfzzltVK+SuLoRt2fFmvrPBMzh4hM8jQh32oJVchUR/nEnPkl8FOq2YFOAtB Hh4XjcguupUI26Gr14KqaZX8PGBT7qy9vFTokcH85h0PI3hnQ6I16m+xJvto9wT7/5jM n5A+yUYXNHg8/mnGvLoO5bXiWnjfVxGvIDrdPPgeT3Lpbyq0kcM1yrRKclWeg0dH1sOi ZeiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :dkim-signature; bh=Bvf/K3Pap9oyykFZkieTi2u9+9Uw7QiFuO8UH5o3PtM=; b=oFl518CDGTm00D76NG1DLEhohsRBQtjIbhm/38/QFvNQaxtQvs+iRoK6ZeCA3qYWR3 Bk6Mbn2UzoPCoX3OiaXxw9OVtpe2Vts68PJ1U5/8KkarN6CBxYw0HT8yfXL/Db34I35p ygaS+QiPhR7KSk6IC/AYddwedf3I1r4L6u+t4gnh71YZ4CbAmsKnCZMgD2cMOIqSDtlB lJ2OQNkcDSJi6UWqvPSkyOdaoHFdoHMp3/KDXhRi6jHSv7l2mIITfORp7eSmmLXqv6D7 EucUFMloMW4Zv3tVNah0uGTvoD/2g+PbCjStQ3rOP9KTy6bYmM6h1xEuZIX2JJ68wFE2 9YSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bdia2dNX; 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 o8si6931675ilu.133.2021.05.21.13.28.59; Fri, 21 May 2021 13:29:11 -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=bdia2dNX; 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 S231337AbhEUUJm (ORCPT + 99 others); Fri, 21 May 2021 16:09:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:49126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231295AbhEUUJl (ORCPT ); Fri, 21 May 2021 16:09:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 891A961164; Fri, 21 May 2021 20:08:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621627697; bh=L0AZm036/M2K55AooynLRoN6JnWPfVJLPizHslblkdE=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=bdia2dNXMChRT1FrUhPyrH5YTyAz24zzWD6MGdmhXx6rJFOkWOcENC5UuFoJkONpu ZRtfuzTVnzfOs8+bisqRrW4QQD0rKBqnxuyNU38TTQo5msofB7NShv3JNEchxjJDKI ja5Ne1KwNDdZItIPe+qCrciyDBbEydTNGj6pzSyeis5cqyMERDh+SftNzKqCQJUzDe x7J7OzkPGZGUvjj+JLEeMdIelxSRjLzl4rHKjIw/vGElRUpA5chWwXhXPKhmB72en7 MNtyhWmCl6a3v09I8Owow5kOEnhnuA28ShIzddvKEDSFquLsazf0Y1M2ngPjgmXVY4 EkNCKmKQdUtIg== Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailauth.nyi.internal (Postfix) with ESMTP id 9660027C0054; Fri, 21 May 2021 16:08:15 -0400 (EDT) Received: from imap21 ([10.202.2.71]) by compute2.internal (MEProxy); Fri, 21 May 2021 16:08:15 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejfedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdet nhguhicunfhuthhomhhirhhskhhifdcuoehluhhtoheskhgvrhhnvghlrdhorhhgqeenuc ggtffrrghtthgvrhhnpedvleehjeejvefhuddtgeegffdtjedtffegveethedvgfejieev ieeufeevuedvteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegrnhguhidomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudduiedu keehieefvddqvdeifeduieeitdekqdhluhhtoheppehkvghrnhgvlhdrohhrgheslhhinh hugidrlhhuthhordhush X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id A9E8F51C0060; Fri, 21 May 2021 16:08:13 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-448-gae190416c7-fm-20210505.004-gae190416 Mime-Version: 1.0 Message-Id: <6c9c4597-a1af-4cbb-9dc8-424999d04793@www.fastmail.com> In-Reply-To: <87k0nraonu.ffs@nanos.tec.linutronix.de> References: <20210415044258.GA6318@zn.tnic> <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> <263a58a9-26d5-4e55-b3e1-3718baf1b81d@www.fastmail.com> <87k0nraonu.ffs@nanos.tec.linutronix.de> Date: Fri, 21 May 2021 13:07:52 -0700 From: "Andy Lutomirski" To: "Thomas Gleixner" , "Florian Weimer" , "Dave Hansen" Cc: "Dave Hansen via Libc-alpha" , "Len Brown" , "Rich Felker" , "Linux API" , "Bae, Chang Seok" , "the arch/x86 maintainers" , "Linux Kernel Mailing List" , "Kyle Huey" , "Borislav Petkov" , "Keno Fischer" , "Arjan van de Ven" , "Willy Tarreau" Subject: =?UTF-8?Q?Re:_Candidate_Linux_ABI_for_Intel_AMX_and_hypothetical_new_rel?= =?UTF-8?Q?ated_features?= Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21, 2021, at 12:10 PM, Thomas Gleixner wrote: > On Fri, May 21 2021 at 09:31, Andy Lutomirski wrote: > > arch_prctl(SET_XSTATE_INIT_ON_FIRST_USE, TILE_STUFF);? > > > > As long as this is allowed to fail, I don=E2=80=99t have a huge prob= lem with > > it. >=20 > I'm fine with that. It's still controlled by the OS and can return > -EPERM. >=20 > If allowed then the application would also accept to be insta killed i= f > that #NM allocation fails. Any bug report vs. that will be ignored. >=20 > > I think several things here are regrettable: > > > > 1. Legacy XSTATE code might assume that XCR0 is a constant. > > > > 2. Intel virt really doesn=E2=80=99t like us context switching XCR0,= although > > we might say that this is Intel=E2=80=99s fault and therefore Intel=E2= =80=99s > > problem. AMD hardware doesn=E2=80=99t appear to have this issue. > > > > 3. AMX bring tangled up in XSTATE is unfortunate. The whole XSTATE > > mechanism is less than amazing. > > > > IMO the best we can make of this whole situation is to make XCR0 > > dynamic, but the legacy compatibility issues are potentially > > problematic. >=20 > Why? The bit can be enabled and #NM catches the violation of the ABI > contract if the application did not request usage. No XCR0 fiddling on= > context switch required. >=20 > Thanks, >=20 > tglx >=20 >=20 >=20 XFD does nothing about signals. It also doesn=E2=80=99t help give appli= cations a non-Linux-specific way to ask if AMX is available. The SDM say= s that one can read XCR0. Sure, we can use it, but cross platform libra= ries seem likely to get it wrong.