From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77277443D for ; Wed, 13 Mar 2024 15:02:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710342164; cv=none; b=W9A/el78nWziqwc1NgoUvX+Jg2XwDFXO+rEyRueaQEgH00DlMR5YllVrFTGpEIfsExZB4JIG0/08OCnGEwRILOhVEoZFk6UBlYL7vA4R87UwpbMANpekDhG6EC5/z6LyEHAoKzVrBGK5o95ZFuvP0rWWZwZzkREjY+KVDaB9RPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710342164; c=relaxed/simple; bh=Rr3keC7DaRs4iZhpH5xfVxefoUXjhck6vAnFqJnwVOo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OOzQZrKAeyPPH9wsnl7Ju015Y/LTMOB4QJclaKctRqx8qtYpbSbNNSGfig53qAG5hu0qMJhBinaqYDqozb/kK8EgsZG26U3p9DUtNfz/Ei5B49zbFWmoAhkC8gee18v8x5y37tIuBtY2SLO/Ece2nrdGm+ofuJG5zQveaT5P5BI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8756C433C7; Wed, 13 Mar 2024 15:02:42 +0000 (UTC) Date: Wed, 13 Mar 2024 11:04:51 -0400 From: Steven Rostedt To: Tatsuyuki Ishi Cc: Peter Zijlstra , Indu Bhagat , linux-toolchains@vger.kernel.org, daandemeyer@meta.com, andrii@kernel.org, kris.van.hees@oracle.com, elena.zannoni@oracle.com, nick.alcock@oracle.com Subject: Re: [POC 5/5] x86_64: invoke SFrame based stack tracer for user space Message-ID: <20240313110451.35458651@gandalf.local.home> In-Reply-To: References: <20230501200410.3973453-1-indu.bhagat@oracle.com> <20230501200410.3973453-6-indu.bhagat@oracle.com> <20230502105353.GO1597476@hirez.programming.kicks-ass.net> <20230502112720.0c0d011b@gandalf.local.home> <4CDF4EB4-C8AF-43DB-88AB-DB4BB76995F2@gmail.com> <20240313105228.2a6bbd2f@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-toolchains@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 13 Mar 2024 22:58:18 +0800 Tatsuyuki Ishi wrote: > > On Mar 13, 2024, at 22:52, Steven Rostedt wrote: > > > > The simple answer is to call irq_work. That will trigger an interrupt when > > irqs are enabled again (returning from NMI and just before entering user > > space). > > > > The return from the irq_work can do the proper ptrace path. > > > > Yeah, that makes sense. Thanks! > Not sure how much overhead a self-IPI causes, compared to forging an IRET, but we can probably measure that later. > I brought up the "forging of an IRET" before, and was told about irq_work ;-) The "forging of an IRET" from NMI will never make it upstream. The NMI handling is already way too complex. Adding more complexity just for tracing user space stack traces will never fly. -- Steve