Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp925256pxj; Sat, 8 May 2021 02:47:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeasgix0pPab/fjlNFbdumeLxSCFPoz+A3hu9Sus3BXuLbbYhU3eGnefaei8emU0NCivqG X-Received: by 2002:aa7:cdd8:: with SMTP id h24mr17012317edw.276.1620467244699; Sat, 08 May 2021 02:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620467244; cv=none; d=google.com; s=arc-20160816; b=gHLx0Ds72E9pY9QEotB7gd2Edpz3cJhz8xX8iLUZQMd2YBs31OOLsPYbOaxd1xLKdK XGV3tPm1EPhDCKx4DQZ822iUv7+eUZklzRUVUy9O9de3rMhgLSiVRgiqwlXeERqnbhW/ bJFdGVdJAPN5/6P8HCXG8vcgfL5x6+pcvSgoZzNFVRC+K8soMr3stSq+3HV2cYnUpNeU snyU+nFRYfa8Sq4RPTZXZ0MVgTTKmPhRdB2xIHgpyWy4LAcP/+N38CdXSX4TxVHAK57w kVOt2nNiqdKrVqbGZTjo1r/wH1SGzGU5d9pJ4UiKP2yORW13xGo76pV/IXlZVzAdZGqn L4Rw== 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=5V2mnN+5XyzmdPeCcUBgDC7Wx1AGdBSa3j7Jt0jotPs=; b=M34gDJ1pvn6MkEwQaFN+Be1HClJ6Fib6B4ytU2Il9r+/FKLKruXxR8qf9ZvIfPGMRU FVKySCfBSxm8hm3+eWPinZNL/Le9P7kMLsAFCJgVHt53L9L9n9q8bMMUh5S34sm7PjHn BSeWi5NFtqcsY46oJe9myL+fU68gPZfNdU/iEGLdrFzoAJo/Fu6euAWjpnMXNUnglC3o hnFup5kb7Cl1h4IW4ke5UrI3dQ8V+2Jr1DXfLqNpThRnxiAVMVhzcLHUi8EVybPUn5tI BX/hE5Ya8e2/PDumkgvZm4MV8X55mxCI2SjxAubfzCTnqO821OBzlk2pVdmLpeH9EqP4 rt+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CZYCg9X7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=zHTsBSRc; 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 d13si253209edj.314.2021.05.08.02.47.01; Sat, 08 May 2021 02:47: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=CZYCg9X7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=zHTsBSRc; 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 S230316AbhEHJq4 (ORCPT + 99 others); Sat, 8 May 2021 05:46:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbhEHJqz (ORCPT ); Sat, 8 May 2021 05:46:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0AA8C061574; Sat, 8 May 2021 02:45:54 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1620467152; 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=5V2mnN+5XyzmdPeCcUBgDC7Wx1AGdBSa3j7Jt0jotPs=; b=CZYCg9X7S7igLlH+mfktuCfAw9b5bCzbEJVFe6O7ePWZ7I7QO5OIXPJD3jRYqLowd1SPYb 2B86xDKW1uZaMqC0wQSe5+xlBukX+ONjgUZ82A9yhGvzs2LwmCyhMJD4DoHlN+J+NBhzTR CzEWA9RgjZC42E8ANWYxhHIZ6UM4MjEiGm9zM/34vMzBbKm5v7Ka4T097onibDuyUpGZ0T ryc0JDJ+0RqOEbQ2wtKhtpoLRUnhC7N3B/y18I2klpW/26CKl4SWvH6CeVpoUocSF2yQU0 /uPShmU0vzPFtI27o7EoI65YvO9vYBT97tbJWXBZ+UiubgOYP+tMQcwKAT1deA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1620467152; 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=5V2mnN+5XyzmdPeCcUBgDC7Wx1AGdBSa3j7Jt0jotPs=; b=zHTsBSRc19KD3cm1gZrWLNvxGiUh6wLowBlz2y+Ue3Xj74pJhIPwAS2ZxAx7g9JGn8UQaM yC2RJDGUuqKpg8DQ== To: Len Brown , Borislav Petkov Cc: Willy Tarreau , Andy Lutomirski , Florian Weimer , "Bae\, Chang Seok" , Dave Hansen , X86 ML , LKML , linux-abi@vger.kernel.org, "libc-alpha\@sourceware.org" , Rich Felker , Kyle Huey , Keno Fischer Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features In-Reply-To: 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> Date: Sat, 08 May 2021 11:45:51 +0200 Message-ID: <8735uxmucw.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 Sun, May 02 2021 at 11:27, Len Brown wrote: > On Fri, Apr 23, 2021 at 3:58 PM Borislav Petkov wrote: > Here is how it works: > > 1. The kernel boots and sees the feature in CPUID. > > 2. If the kernel supports that feature, it sets XCR0[feature]. > > For some features, there may be a bunch of kernel support, > while simple features may require only state save/restore. > > 2a. If the kernel doesn't support the feature, XCR0[feature] remains cleared. > > 3. user-space sees the feature in CPUID > > 4. user-space sees for the feature via xgetbv[XCR0] > > 5. If the feature is enabled in XCR0, the user happily uses it. > > For AMX, Linux implements "transparent first use" > so that it doesn't have to allocate 8KB context switch > buffers for tasks that don't actually use AMX. > It does this by arming XFD for all tasks, and taking a #NM > to allocate a context switch buffer only for those tasks > that actually execute AMX instructions. > > 5a. If the feature is not enabled in XCR0, and the tasks uses > those instructions anway, the hardware delivers a #UD > and the kernel kills the process with a signal. Where is #6 which describes the signal interaction? Thanks, tglx