Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1461739pxj; Fri, 21 May 2021 15:09:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO6Gz87Bbf6RstQPcVz7EZSvMIakJ935qZxrPZmf0NjPn3OshPxF87BMqhbkxA56P1W+OF X-Received: by 2002:aa7:dc49:: with SMTP id g9mr13183778edu.160.1621634986428; Fri, 21 May 2021 15:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621634986; cv=none; d=google.com; s=arc-20160816; b=JsPM6LXxuuIdraTMPy5wkcH4MxXHhXkyQoWPdk2b4rbr4C7Lqcx+I3QBOMjrvgKj9c hodOGvxEAkJw00N/eETfuDcVKXFwePsgqdOj8DZfYAq35HvpjRhvvMbO/YW0FD7EUDxp f7m+xxhH7OJwQYGzIc4QQS6aYQMvwrl3LAYDM+BcSmit0bBB5NleOBgqnUq1wUSCMNc7 10RsNj8zIY3vq1l1UqGI8Q2T5VexTZk75AqebE8OZfB0jljbIfGM9rPBygKLSKjTmZHi mAiutMQu5slQ7+Yq76/UHJF0496wVEmsPmsfJiw69Ui6iBxvK/7IfqFs2Qu6lAzt90Lj N/eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=niV5GMT2/rm4Um55UUKNDRlEI4WL7UCus9zCl0E0G4g=; b=v/1quIMUGjQwHorYn3dGnYwsOZPKXys2ZkM4cye+MpYcUIPlMWUoAqSlfINzB6YSys D+jQI4mQc5sIdyY4d/nBrtQoVmNnvsYBObVbuKd/mlLDCs/s87ymnehuTREfa58m7uYU PbbG2WFpGeKuZbxQ/bZ1iNpL1geQIqGXdRK/s844D2ooUU763In+stEFI4N2rftuT91S OCyl+FZ/indT/oZQOzz6oCIJWLDpxhcbjB/l5XCD2dsVvyL8dDETQzLyRYkFTOCS5xny B1aTOZDgNIT/vVNKkg5wQirSYbm8rBuk3W5bzgAIza2we8CvQIRZiQ83L8+y6RNtlVJj 8k+Q== 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 v1si7944899ejd.643.2021.05.21.15.09.22; Fri, 21 May 2021 15:09:46 -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 S229720AbhEUWIn convert rfc822-to-8bit (ORCPT + 99 others); Fri, 21 May 2021 18:08:43 -0400 Received: from mail-ej1-f45.google.com ([209.85.218.45]:33500 "EHLO mail-ej1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbhEUWIn (ORCPT ); Fri, 21 May 2021 18:08:43 -0400 Received: by mail-ej1-f45.google.com with SMTP id z12so31099108ejw.0; Fri, 21 May 2021 15:07:19 -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:content-transfer-encoding; bh=nAZ3ctVppRd1U/MccQN84z1G3WIdv4u58Ovt2vtZEtA=; b=HxeueTVh07FS/rPlaXpGAgh2YxU9bSqjViSbbVI5pE1QLFNrOBkkg0Y2TRTXDDL6+t phvK9K+419Y/7bstTBIR0+g900muoHdY7txT6mr1C7w7x+QbcIzj5cgx+/cXWfDA/+TH 1x3zAio6vbEDQe9of75AWPffqqArM2zmJmn973OIatiWj2Oc3BUTpPDuJtN3HK0ZJkHe Jq4SuRcAXnM79MUGIDJDyjxJxcF9INBzPHs6LBP5MaEi1A2TDBwXo3gmsrl132hPxKnd WZwHMZPRuIUD4wwuag28b775UURJMka1P1WJjm9Anz4THiSWL2qnVktD4eo6GvA+ewOk 3wgA== X-Gm-Message-State: AOAM532qgjkvVXEk5H9L8FpCn0IsOctiF/qsS0wwZblk1DANZYbFF8Fx eP0Jr9fC/PuvLmi8CH3J6baIQgCVG61MgXpYntQ5+zf1u3c= X-Received: by 2002:a17:907:33d4:: with SMTP id zk20mr12157139ejb.330.1621634838469; Fri, 21 May 2021 15:07:18 -0700 (PDT) MIME-Version: 1.0 References: <20210415044258.GA6318@zn.tnic> <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> <263a58a9-26d5-4e55-b3e1-3718baf1b81d@www.fastmail.com> <87k0nraonu.ffs@nanos.tec.linutronix.de> In-Reply-To: <87k0nraonu.ffs@nanos.tec.linutronix.de> From: Len Brown Date: Fri, 21 May 2021 18:07:07 -0400 Message-ID: Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features To: Thomas Gleixner Cc: Andy Lutomirski , Florian Weimer , Dave Hansen , Dave Hansen via Libc-alpha , Rich Felker , Linux API , "Bae, Chang Seok" , "the arch/x86 maintainers" , Linux Kernel Mailing List , Kyle Huey , Borislav Petkov , Keno Fischer , Arjan van de Ven , Willy Tarreau Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21, 2021 at 3:10 PM Thomas Gleixner wrote: > > On Fri, May 21 2021 at 09:31, Andy Lutomirski wrote: > > arch_prctl(SET_XSTATE_INIT_ON_FIRST_USE, TILE_STUFF);? > > > > As long as this is allowed to fail, I don’t have a huge problem with > > it. > > I'm fine with that. It's still controlled by the OS and can return > -EPERM. > > If allowed then the application would also accept to be insta killed if > that #NM allocation fails. Any bug report vs. that will be ignored. Regarding pre-allocation vs on-demand allocation, consider two scenarios: 1. Synchronous. At process or thread start up time, prctl() synchronously allocates 8K context switch buffers. Return code is 0 -- good go go! 10 seconds later the program decides to create additional threads. Woops. vmalloc failed, and the process synchronously dies. bug filed. 2. On demand. Same scenario, except vmalloc failure upon creation of those additional threads sends a SIGSEGV at the instruction where AMX is touched. bug filed. Why ignore the 2nd bug and not ignore the 1st bug? My concern about synchronous allocation is that it will be very easy to abuse. programs and threads can ask for buffers they will never use. With on-demand allocation, we allocate buffers only if they are actually needed. Len Brown, Intel Open Source Technology Center