Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp663889pxb; Fri, 16 Apr 2021 15:13:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymrkuG4qSmkMtpys59JhB4FjUsFk1mTSv484IuZYp0W7SP5SS5lBT9Q71OlIH3brZuHGWM X-Received: by 2002:a17:906:51da:: with SMTP id v26mr10281572ejk.212.1618611206156; Fri, 16 Apr 2021 15:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618611206; cv=none; d=google.com; s=arc-20160816; b=jVrJAcAcscnhf7mU1arInYLixW8fVWnIr1uWlatkPI/kvDECSHep8+9Ea2uBKrOzf+ BOqdoSm1iLRVM0HiNpLBxr0by6721y3RP/GmH9PEW8vJ21Q/yrM6uNtLMXoYcyCzXITE HD3g3LyN6DsVREvgonx+vmVYVtbNaVVGO8BdCv5z7ClNtRXtP92oOuVVkbb7B0GZqgOQ Zd+f4Vw9l5qQWd1PUcsHYxHLahgKz2ucgWKF54TB3oeOY/QJ1Emr2iuJquE96hsQU8Fe b3J1sKpxrpzri4C1v9dCxFzkHHET5Mr0v2OjI4YVt4g0WoLtklzVYBLQSrfWwUWFCY9+ FcTg== 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=uNYtdO/g+6WIOvgKoAiURTxI1+VyUIZi9jzIsXvYayY=; b=FKOCoC1LjN9wA2TJPTr0VmhGjShau3bvl2JYRYoWtuoBisd4sW7HR2uNo+GGCf+ZON IymXMjvGzyHGOyeuChwY8spD2YjcUq/KCrsWNq2JPvvUs4AXvlHFZNfGmF5PzdIbsd4b CwuOR3XNSYBk1Mdk5T1FP/bvL6hrLGFTG11YvhrR5B1gFlRFZ0+hWw9dFefEG3CzSw1A RKHQOpW703MQ1azhY9Kr3i06qhRF6e/UWcQwL+8bDyjWsdBQIistHUS79SHiLW1BQkdm KKL8ZU57elgUJkgM2M/mBKKNM9jCbb8HOMPHmWohJzQsgcjAmytv+cy6qOmAhCjqemb9 7fQA== 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 f19si7626870edd.510.2021.04.16.15.13.03; Fri, 16 Apr 2021 15:13:26 -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 S235192AbhDPVzX (ORCPT + 99 others); Fri, 16 Apr 2021 17:55:23 -0400 Received: from mail-ej1-f44.google.com ([209.85.218.44]:34587 "EHLO mail-ej1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbhDPVzW (ORCPT ); Fri, 16 Apr 2021 17:55:22 -0400 Received: by mail-ej1-f44.google.com with SMTP id x12so23397421ejc.1; Fri, 16 Apr 2021 14:54:55 -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=uNYtdO/g+6WIOvgKoAiURTxI1+VyUIZi9jzIsXvYayY=; b=rfvOqXrz7rkqVBa+rMVtyq2bieLDCBUDwVb0xpP5NSzjJpR+4Lb6BX2xXtFMAPP9yT UAyX/O5Ftc4GQqCaR0OgS5mkYkilI0ZRK4Ln95X8PzKazAEiztUoxR/tOEJF9e9JmdGd lAFjDS2YSkaLt9eSReVPHm+tuzirk8dmjBPxfatydXeucEw7qTh9ucKxbig5eoHwxRst mrXFDsP+YAKdHFUPC5SagrZPmkA3JHvXYMrrIcnlCkyB7fPrslaD127LkTWxQtBQP1WH LPfaJMw8KG+1OoiWigu7JoevuYSiect4Fv9ECMQA0U9omdhZSPDSCvUk2IJMZeCWPw4j 1YhQ== X-Gm-Message-State: AOAM531iFKQrbFtKcSv3ks5MQg+LPgs/AM65yad7gA2PJVuUknbJPBE6 Q3f1NwK9P6M9mP1lV0M6aKFsCxnm4yWIZPNLuCQ= X-Received: by 2002:a17:906:ca45:: with SMTP id jx5mr10461248ejb.417.1618610094953; Fri, 16 Apr 2021 14:54:54 -0700 (PDT) MIME-Version: 1.0 References: <87lf9nk2ku.fsf@oldenburg.str.redhat.com> In-Reply-To: From: Len Brown Date: Fri, 16 Apr 2021 17:54:43 -0400 Message-ID: Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features To: Andy Lutomirski Cc: Willy Tarreau , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 15, 2021 at 12:24 PM Andy Lutomirski wrote: > On Wed, Apr 14, 2021 at 2:48 PM Len Brown wrote: > > > ... the transition penalty into and out of AMX code The concept of 'transition' exists between AVX and SSE instructions because it is possible to mix both instruction sets and touch different parts of the same registers. The "unused" parts of those registers need to be tracked to assure that data is not lost when mixing. This concept is moot with AMX, which has its own dedicated registers. > What is the actual impact of a trivial function that initializes the > tile config, does one tiny math op, and then does TILERELEASE? 1. Task takes #NM on first touch of TILE registers 2. Kernel allocates 8KB for that task and dis-arms XFD 3. Kernel context switches XFD with task state If the task takes a signal *before* TILERELEASE 4. XSAVE transfers AMX state to signal stack, XRESTOR the reverse. If the task context switches *before* TILERELEASE 5. kernel context switch XSAVES the AMX state to 8KB context switch buffer, XRESTORE the reverse. If the task takes a signal *after* TILERELEASE 4. XSAVE does NOT transfer AMX state (or zeros) to signal stack, 8KB is consumed on signal stack but not touched. XRESTOR, the reverse. If the task context switches *after* TILERELEASE 5. kernel contexts switch ignores INIT=1 AMX state. 8KB buffer is quiescent. As we discussed previously, there is no impact to frequency from either INIT=0 or INIT=1 AMX state. Frequency is impacted by *compute*, and since there isn't any compute this scenario, there is no frequency impact. As we discussed previously, for INIT=1 (which the kernel guarantees, there is also no impact on power. thanks, Len Brown, Intel Open Source Technology Center