Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1401691pxj; Fri, 21 May 2021 13:21:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6dx/+ehRmKahdiQaaK+LRNCpnIRnwHLPakZ6vJlBeQyiEhIT5aIxc0GC6Iu4xcsBQ46wf X-Received: by 2002:a5e:9907:: with SMTP id t7mr569627ioj.155.1621628507912; Fri, 21 May 2021 13:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628507; cv=none; d=google.com; s=arc-20160816; b=fIHyBbk+3/8wzszZP8fOERqs/NBHRWXcX/JX7BEQX9u0fpD+mfx5kFmMSM3wpnb9yX CvhbwR/zw+zVKpq2+l3+/9g5eHPgzwEspiS6ChYiuyIIu0yRBEbHRyaGvDw1qPfKKbgU xNYqYlOIqBGeTX4+GyS2j0MT03SGI9DSwOQHBasMWkwK3xhmkB6Vzp1MZUH/w/fm5XTc ISvYqSThDtrNigN3Srb0DjzSTPpbRXBQEqxmtIRNWJZmPUC23LfJNwI5yeNwfKsSpPNr yxzznS+mjlTy7nQiNsPS3L+WNMBUCcMLvvkzeUAW7GTMVn0OE24hrB9nhhkafx2cRcUa vgaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=tmnJlJJivkksjDLx2Lgi9UeaAfE6lSqBa1f4XbYR5DM=; b=yUM1HzUU1kZA6bfFJZKkrzVCfEikAQxDtbU5tm68DFQiuJfzNH/D16vV2TcC6lfNqR 0J/DHT4DQ0fUYYOPU2lrj1AJ9savNlIVhpUVDstvCFCe0r2ANjmfH7+t0Zyumj85pKwL YlA5MXsBXquX8ixg5vcsT6gmKkJuOuGk42DYZ8QZNFuNLrRwrRCCYIY2Auf0NYzIqxXm /64fiwFOBsct4YtAE5RD951xLOI8N4Zfv8znbXycEdGcrfrxlZKqx8zMbBqO55Elbtub G4gw42F9MFGeGbmQgX0PjbUl4l6vNNnxad6IL4/8epx9DWv2wijfJlQLkVT0o1u4nV4A bBSQ== ARC-Authentication-Results: i=1; mx.google.com; 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 w8si5998872iou.72.2021.05.21.13.21.35; Fri, 21 May 2021 13:21:47 -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; 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 S235188AbhEUQ2C (ORCPT + 99 others); Fri, 21 May 2021 12:28:02 -0400 Received: from mail-ej1-f52.google.com ([209.85.218.52]:34507 "EHLO mail-ej1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234735AbhEUQ2B (ORCPT ); Fri, 21 May 2021 12:28:01 -0400 Received: by mail-ej1-f52.google.com with SMTP id p24so30099599ejb.1; Fri, 21 May 2021 09:26:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tmnJlJJivkksjDLx2Lgi9UeaAfE6lSqBa1f4XbYR5DM=; b=TppP9wyr5m62m2f5d0qA05iiLsOCZncjscb9Iaaj9I8EgmCk6e+fC+HncCrhR9g8PU 32nwyLj6LXetjIpSEW+4EDz1dE/oIOXr7HB0vM5ybunruWEDgBZTbXZx0lWhtoVCpO3Q qfcL8u2GjywDy5qVsozYG+Y3xKTu4/xynhZCVyG0hKEA+AuPUDKUSO1i4GAOx3ErKU67 unXq3MYYY2PeEDNEp4Nm/pg4xfDouDGLR2y9eWEPrQNjERU/FIDkMZYu87vtdy9zzWWf GYRERF3LuZwvDD336Jy6EmVO0OVBX3xp+Bd74/UBzyGeKLlrmvkJHndAJVmcFsDtEZZf E0Hg== X-Gm-Message-State: AOAM531vhs4vL4DR0jFWRUmCEumh7SbZDRaMAwInLKve+j6CTU6xyTq/ kNY2IyvMHccNsElowrRB/4ZJT0cJhMoUBTPmZt8RoDNx X-Received: by 2002:a17:906:4f91:: with SMTP id o17mr11042518eju.219.1621614396758; Fri, 21 May 2021 09:26:36 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <87r1i06ow2.fsf@oldenburg.str.redhat.com> From: Len Brown Date: Fri, 21 May 2021 12:26:25 -0400 Message-ID: Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features To: Florian Weimer Cc: Dave Hansen , Dave Hansen via Libc-alpha , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21, 2021 at 12:19 PM Florian Weimer wrote: > 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. That is a reasonable summary. > Is there still a chance to bring the hardware and Linux into alignment? The hardware was done some time ago, so this is a Linux decision. The current trajectory is that for user space to use TMUL it must 1. query CPUID to see if the instructions exist 2. query xgetbv(XCR0) to see if the OS supports the state 3. Tell Linux that this thread wants to use the state. The original proposal required just #1 and #2. It is clear that Linux can not support that, and so #3 is being added. Of course, if #2 is false, then Linux will return failure for #3, so technically you could skip that check and just make this new syscall. Probably user-space will still need to query CPUID for the instructions, since there will be a many-to-one mapping of instructions to state. Len Brown, Intel Open Source Technology Center