From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC05BC47076 for ; Fri, 21 May 2021 16:26:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C267D613AD for ; Fri, 21 May 2021 16:26:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234758AbhEUQ2C (ORCPT ); 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-Google-Smtp-Source: ABdhPJxz+dKx/EgTqHJREKd6K0s+yqNUvC5CmqZcyaTmfjAn3iOLHqTwmCxlpzBPU4/TP+lsuymzSUcqXdEhob3PDwU= 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-api@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