From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by sourceware.org (Postfix) with ESMTPS id 057E1394483E for ; Fri, 23 Apr 2021 19:35:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 057E1394483E Received: by mail-ed1-f48.google.com with SMTP id j12so33608376edy.3 for ; Fri, 23 Apr 2021 12:35:43 -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=gIuJQ0zh3viNBczyKYB2fhbiaLgRnT4n+rCK9rNkZDg=; b=sNu6LFOP0XOU3pImkeWvOEuFU31vrvmyNkLt0tp6QlZELzks9wIQxu5GVduNlrjPD4 Bd3c5R0rtNkMgKejjf7qmgT5tFNISBrLBVm1G4WU5itDV4dHikNsnu6C5s9sx5Z0PLbw 6wwqxjJDfj2j51ItwPluOoZZ2d0FfMHaHk++WXyYGbximQSgWYDqq4aEpZ7yDSbAQv7c 5Z9ab6U7SnhMNo9AtlnM+xVu0Xx3uzm65ca9rJuNaZR6MOLPcnrqoA0KUZZ+4CFvMS37 TTWkuvsdLRoN3GiFjOcHB3ewcqWFWh/VzgN7pYXjKIXJF+JeuZaqXN5jp/4fMovAoHev CKww== X-Gm-Message-State: AOAM531S6PZ9VuDW+adIjpAyaDTSR18azwMzEFlFQogix1vg7Lc07Oio J47LuHVqM/lbFzQKuRTisRtOwBVfzaDMWAvpwCo= X-Google-Smtp-Source: ABdhPJygyn0q4rDisgKpgzZFbtCvXd00pA1BEv3Q+3EXywkGito2udfG1uByIxVRDVqVz7/aaTjEUBHW7xWXzh4iJJs= X-Received: by 2002:aa7:d1ce:: with SMTP id g14mr6325912edp.122.1619206543054; Fri, 23 Apr 2021 12:35:43 -0700 (PDT) MIME-Version: 1.0 References: <20210414095804.GB10709@zn.tnic> <20210415044258.GA6318@zn.tnic> <20210415052938.GA2325@1wt.eu> <20210415054713.GB6318@zn.tnic> <20210419141454.GE9093@zn.tnic> <20210419191539.GH9093@zn.tnic> <20210419215809.GJ9093@zn.tnic> In-Reply-To: <20210419215809.GJ9093@zn.tnic> From: Len Brown Date: Fri, 23 Apr 2021 15:35:30 -0400 Message-ID: Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features To: 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 19:35:49 -0000 n Mon, Apr 19, 2021 at 5:58 PM Borislav Petkov wrote: > > On Mon, Apr 19, 2021 at 05:33:03PM -0400, Len Brown wrote: > > For this to happen, every thread would not only have to include/link-with > > code that uses AMX, but that code would have to *run*. > > ...the *library* does that decision automatically! > > Which means *every* possible thread on the system. > > Which means, *every* thread has a fat 8K buffer attached to it because > the library uses AMX on its behalf by *default*. Yes. If a library decides to execute AMX instructions on behalf of a task, the kernel will allocate an 8KB context switch buffer on behalf of that task. True. Nothing prevents every user task in the system from executing AMX instructions, whether explicitly or in a library, and the kernel will transparently allocate an 8KB buffer for each one. I do not know anybody who predicts or expects that every task in the system, or a universally executed library routine, will find a reason to run AMX instructions. Again, if that were the expectation or the intent, the proposal would be to statically allocate an 8KB context switch buffer on AMX hardware, instead of dynamic allocation. Today, libraries routinely probe for what instructions are available and decide to use them, or not. I think that most customers consider that a desirable feature -- since it allows them to run the same application on multiple hardware generations and get the most out of each generation. I respect your right to dislike that feature. Granted, if you find a reason to dislike AMX, the mechanisms to disable it today are on a system-wide basis, not on a process or task basis. Len Brown, Intel Open Source Technology Center