Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp33977pxf; Wed, 31 Mar 2021 15:47:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+OKtaacGs61j0lfZj6muNALKysTfbLXMrYl5KQp52fOkfN+6eeNumPjmrgFVFpPq4bguV X-Received: by 2002:a17:907:10ce:: with SMTP id rv14mr6293485ejb.56.1617230843772; Wed, 31 Mar 2021 15:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617230843; cv=none; d=google.com; s=arc-20160816; b=jyk8MF5UcrG4dULl8kO0UiaBKPjkCFHGY3uS7Yr3pCgnxmieaOWYrkvmLUrR+g5VYF eyeo1AhQdUxNgtpYp/tE1gMvuGL4AnnR3GWgV1ePnEuF4xtWHjla5x++254GjpnFVteQ pJx1SCyGrG83X3GjHl1wtBuPKtIIFtB+c8i5uvBMJ69Lz9HFF0LhxcdSsrQSrpaydI9S MZ6Ur+7j5WvFZ+/qSJcZl0Lc5pCypPlCHwZoyL2esrGnJtstvrRJiy13+94ZEGteFyOp I1BkVRDF6Ci8CGiaZWgiN+3TAnMKfqiN3vLXlG+lbn4AlUi18IX1nUdNl8c2bgHFR/Th snDw== 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 :dkim-signature; bh=qQ1c+FRlODAbjIb3//kBLNYgXLIhHxbbJ93S4e4ud68=; b=NG9cldk9OpSKvcHCdxnBjew8A7K776tTi0McqmwhiNApyH2T9NXJ/5rjrnkJYT7c2R 8/qYdwQULJ6+c2bPY/AAexuG+F/NKhqm6bOLTo401Jd/VLHmFGdtanJYBkXBzLY7H0R0 lDp0q+MF/HWsuWnxRqmVvavWGQVVMWCGg5xbdNg5Hm0rySvLMjUsBJevSpZEKbdz8VpD KJWZ+SKbPMN5ZUuVdc0jgKG/XUE/GUEtvBJjnBacRl2izTOtdeKpdyMpPU8PRxwgqQp9 hp9LdEUWlez5pxgnjy/KuZQRZOXfKwjUCn2Wb0scenbXQfXrELNmuySi1ViJJT/lK9Yz Uyzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u1Uyl5p7; 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 g25si2812132eds.27.2021.03.31.15.47.00; Wed, 31 Mar 2021 15:47:23 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u1Uyl5p7; 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 S232271AbhCaWps (ORCPT + 99 others); Wed, 31 Mar 2021 18:45:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:39180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhCaWpW (ORCPT ); Wed, 31 Mar 2021 18:45:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D54826108D for ; Wed, 31 Mar 2021 22:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617230722; bh=3Npb6Zu3DJw/HynXi+oVJZahQt437+yrIYrwcSK5DQE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=u1Uyl5p7jTOPv+XhIr1pdo0/HK1e9UwrBM813xOUbU/1YdwzokWEry22ijhoGpr2U GAb1PNvB/u0UGGluAYcoDGshCyqU4W6vkkrWIagMbfENEe/zwzP0UNuJSc7MWcbJCO J36YHtWXUdlx7jJFi1+yCGQcdVYCA4OkZACwrYYmcAH+H4Qi2JvkUhceUVlTt0s7id dG6lEyLqZIEmV+QrG7B5JdmXBOKzGmLMRQx10mlGu0hVOYoNuTuHInDmQxo8FKPcMa U+UrpPBTr8n/bc2eMsiO13VPdyc7ROub+92IFBc3QMJbr7Vd3clFGIh8ZzhaU7r82k D73DQ9tyZirwg== Received: by mail-ej1-f52.google.com with SMTP id r12so9226ejr.5 for ; Wed, 31 Mar 2021 15:45:21 -0700 (PDT) X-Gm-Message-State: AOAM533KvMmwSnWZ8KhbSwPFNHxuXK+wkOR1kUyBolYZhaEXKGT2uN2m +9nCOOlh/RRVZe+E81E+DRAI2AW0Xp9Liq6XIqXWOA== X-Received: by 2002:a17:907:e88:: with SMTP id ho8mr6255028ejc.199.1617230720393; Wed, 31 Mar 2021 15:45:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andy Lutomirski Date: Wed, 31 Mar 2021 15:45:09 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features To: Len Brown Cc: David Laight , Dave Hansen , Andy Lutomirski , Greg KH , "Bae, Chang Seok" , X86 ML , LKML , libc-alpha , Florian Weimer , Rich Felker , Kyle Huey , Keno Fischer , Linux API Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 31, 2021 at 3:28 PM Len Brown wrote: > > On Wed, Mar 31, 2021 at 12:53 PM Andy Lutomirski wr= ote: > > > But this whole annotation thing will require serious compiler support. > > We already have problems with compilers inlining functions and getting = confused about attributes. > > We added compiler annotation for user-level interrupt handlers. > I'm not aware of it failing, or otherwise being confused. I followed your link and found nothing. Can you elaborate? In the kernel, we have noinstr, and gcc gives approximately no help toward catching problems. > > Why would compiler support for fast-signals be any more "serious"? > > > An API like: > > > > if (get_amx()) { > > use AMX; > > } else { > > don=E2=80=99t; > > } > > > > Avoids this problem. And making XCR0 dynamic, for all its faults, at le= ast helps force a degree of discipline on user code. > > dynamic XCR0 breaks the installed base, I thought we had established that= . I don't think this is at all established. If some code thinks it knows the uncompacted XSTATE size and XCR0 changes, it crashes. This is not necessarily a showstopper. > > We've also established that when running in a VMM, every update to > XCR0 causes a VMEXIT. This is true, it sucks, and Intel could fix it going forward. > > I thought the goal was to allow new programs to have fast signal handlers= . > By default, those fast signal handlers would have a stable state > image, and would > not inherit large architectural state on their stacks, and could thus > have minimal overhead on all hardware. That is *a* goal, but not necessarily the only goal. --Andy