Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0D96C433EF for ; Wed, 12 Jan 2022 21:01:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229612AbiALVBR (ORCPT ); Wed, 12 Jan 2022 16:01:17 -0500 Received: from albireo.enyo.de ([37.24.231.21]:37268 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiALVA5 (ORCPT ); Wed, 12 Jan 2022 16:00:57 -0500 Received: from [172.17.203.2] (port=33343 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1n7kjV-00GoGu-Dj; Wed, 12 Jan 2022 21:00:37 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1n7kjV-003dn8-32; Wed, 12 Jan 2022 22:00:37 +0100 From: Florian Weimer To: Mathieu Desnoyers Cc: Peter Zijlstra , linux-kernel , Thomas Gleixner , paulmck , Boqun Feng , "H. Peter Anvin" , Paul Turner , linux-api , Christian Brauner , carlos Subject: Re: [RFC PATCH] rseq: x86: implement abort-at-ip extension References: <20220107170302.8325-1-mathieu.desnoyers@efficios.com> <87a6g7ny0j.fsf@mid.deneb.enyo.de> <1968088162.13310.1641584935813.JavaMail.zimbra@efficios.com> <87y23l6l2j.fsf@mid.deneb.enyo.de> <87sftt6j0u.fsf@mid.deneb.enyo.de> <396330808.24806.1642005485899.JavaMail.zimbra@efficios.com> Date: Wed, 12 Jan 2022 22:00:37 +0100 In-Reply-To: <396330808.24806.1642005485899.JavaMail.zimbra@efficios.com> (Mathieu Desnoyers's message of "Wed, 12 Jan 2022 11:38:05 -0500 (EST)") Message-ID: <87h7a87jpm.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Mathieu Desnoyers: > ----- On Jan 12, 2022, at 11:00 AM, Florian Weimer fw@deneb.enyo.de wrote: > >> * Peter Zijlstra: >> >>> On Wed, Jan 12, 2022 at 04:16:36PM +0100, Florian Weimer wrote: >>> >>>> You could perhaps push a signal frame onto the stack. It's going to >>>> be expensive, but it's already in the context switch path, so maybe it >>>> does not matter. >>> >>> Please no! Signals are a trainwreck that need change (see the whole >>> AVX-512 / AMX saga), we shouldn't use more of that just cause. >> >> If it's a signal, it should be modeled as such. I think it's pretty >> close to a synchronous signal. (an asynchronous signal) > Florian, just to validate here: is your argument about AVX-512/AMX or about > rseq abort-at-ip ? rseq abort-at-ip. I wonder if it is possible to use regular stack unwinding (through the signal frame) to figure out where the abort happened, and use the existing cleanup handler functionality in GCC. (Although -fnon-call-exceptions is not quite up to this, but in theory we would have to fix this for POSIX asynchronous cancellation/Ada asynchronous transfer of control support anyway.)