Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4570341pxf; Tue, 30 Mar 2021 10:58:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL+dQPoI20zvE1yi5X5M10H0y19HRL/z+GAbA/Q4T59fXLixEvmftq2byWioMC5PjQuJOU X-Received: by 2002:a05:6402:888:: with SMTP id e8mr34444914edy.51.1617127093186; Tue, 30 Mar 2021 10:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617127093; cv=none; d=google.com; s=arc-20160816; b=QjJWVg5nPRacpokcwDPG1B5bMGMCC7a1WN19FatSHCZTqejpwNiIWfkvoABaH6AY5h 0j8ZXoZQPstCyhjro6F1ZPWmC9+FJbtiDe0hVXxJyrMmh0RFxzY+Du+bDGzdqTF4z7XT /ufJWopdtboxll3IwjArzIdIZhNF/tQlMkfEBN1BJrb7h/cdTRP5q70DgwKxOtxCQZ1V fWQHRMr/We9i+MpaX8ZP/lMVNLkVVnIRxQOEPOmq9Iuq6tjA9R6KdRtOcLYTPjWegoew Mx1N7unfWRtd1+zjOyehca8JlYRvsWP0NKQWEBG6/49buIRzFDg5ZJLBdSmR9uA6gAAN go4g== 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=MXeGBfsLp2zw801coODtM6O/GpqSZuwvaPrIda6t8Xw=; b=Anv7uTslcLT1CA3uhsbDpEUuw2ShJYxPHR8/jY724ikzWngM74coFBhzW35lZnFBaC gtspbCeYw5zyrprtHiu53MFzYDyT7KKV45E3e5mhH15L3cqH11/qyvQLw73fG+aa+NkH gagNt2Fd1z/o6JysPo7+sZKVHFIeNDFsTpJbRXUtXtVBIoxS7/D8jqrKUsXs7CcQ/yEc Yk16feOHrCy7ODa8CVUEUZN5/qq1885mYa78cMfQnkWJIP3LNQ0PLvdovsxCu+6mQoMU mNF+dME4HZQserhchGWEh0SfHAP0Ni6SevRI6ZNvCMMKvVZYe7YgL2ufIymDrBYsNNPf AkHQ== 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 n12si15052981edo.340.2021.03.30.10.57.49; Tue, 30 Mar 2021 10:58:13 -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 S231910AbhC3R40 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 30 Mar 2021 13:56:26 -0400 Received: from mail-ed1-f44.google.com ([209.85.208.44]:37555 "EHLO mail-ed1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232439AbhC3R4T (ORCPT ); Tue, 30 Mar 2021 13:56:19 -0400 Received: by mail-ed1-f44.google.com with SMTP id x21so19224891eds.4; Tue, 30 Mar 2021 10:56: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=eD2VmTYsiHmGfgPXc7YnjSan4NfejYpT6i+aQbGS1AQ=; b=imV7FOBi9QTMtR4TRBBADOy6MgvOxWcbMoa8tH4fK/T96eYCVZSGql6hBoVanJDqBQ djfbbn2nYfD5vii4VhYm/dZkf7zsaxBJzurs8p8/Hrtm2RnceLG5TgmoZHIkAo9nmVV5 aDXRduKH2UxWDO/FpKavigDj6qRvHok2LrnE7lciedtho31NWjtN+VA4/uz3VvX335TI zHy1XoDMcX5WhZ4KztSg4UAxSLdShdxYaG9xXleW9pnulRB8+HFRX30lIv5ZoMU42w+u hfKLHhGRC9DZ+WskwQlgq+aQUyfZFnXfH9LRz+iD/mNaGndQS4sa6E741EPeVubQy8+d g/VQ== X-Gm-Message-State: AOAM532ntZLI+7MPaFGebxXPKhIZLEfHJsssVpv72Og1jjnsINbicmWL Xc0dtwV50OrdznfdqxnjqiEuy0juPh2ShF1X0q4= X-Received: by 2002:a05:6402:4245:: with SMTP id g5mr35405148edb.306.1617126978544; Tue, 30 Mar 2021 10:56:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Len Brown Date: Tue, 30 Mar 2021 13:56:07 -0400 Message-ID: Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features To: Andy Lutomirski Cc: Andy Lutomirski , Greg KH , "Bae, Chang Seok" , Dave Hansen , 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: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 30, 2021 at 1:06 PM Andy Lutomirski wrote: > > On Mar 30, 2021, at 10:01 AM, Len Brown wrote: > > Is it required (by the "ABI") that a user program has everything > > on the stack for user-space XSAVE/XRESTOR to get back > > to the state of the program just before receiving the signal? > > The current Linux signal frame format has XSTATE in uncompacted format, > so everything has to be there. > Maybe we could have an opt in new signal frame format, but the details would need to be worked out. > > It is certainly the case that a signal should be able to be delivered, run “async-signal-safe” code, > and return, without corrupting register contents. And so an an acknowledgement: We can't change the legacy signal stack format without breaking existing programs. The legacy is uncompressed XSTATE. It is a complete set of architectural state -- everything necessary to XRESTOR. Further, the sigreturn flow allows the signal handler to *change* any of that state, so that it becomes active upon return from signal. And a proposal: Future programs, which know that they don't need the full-blown legacy signal stack format, can opt-in to a new format. That new format, can be minimal (fast) by default. Perhaps, as Noah suggests, it could have some sort of mechanism where the program can explicitly select which state components they would want included on their signal stack, and restored by sigreturn. If the new fast-signal format is successful, in a number of years, it will have spread to have taken over the world. thoughts? Len Brown, Intel Open Source Technology Center