From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A897C07E9C for ; Tue, 6 Jul 2021 15:11:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2330461C28 for ; Tue, 6 Jul 2021 15:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231504AbhGFPO3 (ORCPT ); Tue, 6 Jul 2021 11:14:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:47632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232549AbhGFPOX (ORCPT ); Tue, 6 Jul 2021 11:14:23 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2ED2C619AE; Tue, 6 Jul 2021 15:11:43 +0000 (UTC) Date: Tue, 6 Jul 2021 11:11:36 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Masami Hiramatsu , Josh Poimboeuf , Ingo Molnar , X86 ML , Daniel Xu , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kuba@kernel.org, mingo@redhat.com, ast@kernel.org, Thomas Gleixner , Borislav Petkov , kernel-team@fb.com, yhs@fb.com, linux-ia64@vger.kernel.org, Abhishek Sagar , Andrii Nakryiko Subject: Re: [PATCH -tip v8 11/13] x86/unwind: Recover kretprobe trampoline entry Message-ID: <20210706111136.7c5e9843@oasis.local.home> In-Reply-To: References: <162399992186.506599.8457763707951687195.stgit@devnote2> <162400002631.506599.2413605639666466945.stgit@devnote2> <20210706004257.9e282b98f447251a380f658f@kernel.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Tue, 6 Jul 2021 09:55:03 +0200 Peter Zijlstra wrote: > > But I'm not so sure how ftrace treat it. It seems that the return_to_handler() > > doesn't care such case. (anyway, return_to_handler() does not return but jump > > to the original call-site, in that case, the information will be lost.) > > I find it bothersome (OCD, sorry :-) that both return trampolines behave > differently. Doubly so because I know people (Steve in particular) have > been talking about unifying them. They were developed separately, and designed differently with different goals in mind. Yes, I want to unify them, but trying to get the different goals together, compounded by the fact that almost every arch also implemented them differently (in which case, we need to find a way to do it one arch at a time), makes the process extremely frustrating. > > Steve, can you clarify the ftrace side here? Afaict return_to_handler() > is similarly affected. I'm not exactly sure what the issue is. As Masami stated, kretprobe uses a ret to return to the calling function, but ftrace uses a jmp. kretprobe return tracing is more complex than the function graph return tracing is (which is one of the issues I need to overcome to unify them), and when the function graph return trampoline was created, it did things as simple as possible (and before ORC existed). Is this something to worry about now, or should we look to fix his in the unifying process? -- Steve