Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp812694pxb; Fri, 22 Apr 2022 11:42:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpdSs975lM31losWtj8ukonu0o8lNFH+kFRIW3v5rz9eLDkqr5BXymi4z1LPM5OvdG6cOu X-Received: by 2002:a05:6a00:248a:b0:50a:b853:4e5a with SMTP id c10-20020a056a00248a00b0050ab8534e5amr6373673pfv.21.1650652927338; Fri, 22 Apr 2022 11:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650652927; cv=none; d=google.com; s=arc-20160816; b=q07yNu4Kn2fnrs61iltsGj7JQjpodQK1so2gCif6YbU4EM0wP8Z8JycA9WMrjc0yfu R41x7I3mumjOM56UHt5+PrTdb3L2vMONILXijqHVySNeQavsazVq4wiY2ypL27lFGkGK kAUcBiJ03dNXu+8wAJ0fJCn46rHiqswnHMVXXYu41s1QON/7onu2GmHDsoywUJYNn3dh sDiQeTMGTS5zkn8GzbqN7JkTCA/VStHI8DUXO4+cmqStVSQafLbg10uzh+SIe8G1vt9c /NEGOPG93R6opMEGxxGjnsprVFk8+y2lDoby4KmRJzY/n9LP53tXlWyVnBe4b2U1iMmH k5rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=EuAQ3xgewiCGMHPote8WBH5O3HP0iJ8H6tDGB6iEdr8=; b=kUKhYRc7okHxEy+0Luz/mdGTCueeEnjzyqTsb1EppAXIWW7oCUO3cxVulOJfgedKgW 8yvE7sHTz4ODpCqD3/B1EMtJAun+cXr9w1ljBlNx4WjEhvnk/gxBiTwKfAx7kZeMzPzs mIGN+bwWRI9qKF8ru3R9zU7WqIxbCS/+G40Ipy4ggpLovjbh4Nw41dRJRahXBFEvYa7L w2F9i24Oyn6k6PEWLS1ZI/AHBe1Syb3WjNm8Nyhgho6A0IZgJrj4CL54yiGuGJj2jghJ L2bXy/bJxT53Qtm03EADf0dCg6a6CAqE5tuB+Uj5BIqkHRhX0LQAaarKFlARmhUsX8+B 6ZEA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w23-20020a1709027b9700b00156a40a7207si8662924pll.70.2022.04.22.11.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 11:42:07 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CA97FF5997; Fri, 22 Apr 2022 11:11:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390532AbiDURJo (ORCPT + 99 others); Thu, 21 Apr 2022 13:09:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349367AbiDURJm (ORCPT ); Thu, 21 Apr 2022 13:09:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 952AA40907 for ; Thu, 21 Apr 2022 10:06:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0894461DC7 for ; Thu, 21 Apr 2022 17:06:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24B18C385A1; Thu, 21 Apr 2022 17:06:50 +0000 (UTC) Date: Thu, 21 Apr 2022 13:06:48 -0400 From: Steven Rostedt To: Mark Rutland Cc: Wang ShaoBo , cj.chengjian@huawei.com, huawei.libin@huawei.com, xiexiuqi@huawei.com, liwei391@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, zengshun.wu@outlook.com Subject: Re: [RFC PATCH -next v2 3/4] arm64/ftrace: support dynamically allocated trampolines Message-ID: <20220421130648.56b21951@gandalf.local.home> In-Reply-To: References: <20220316100132.244849-1-bobo.shaobowang@huawei.com> <20220316100132.244849-4-bobo.shaobowang@huawei.com> <20220421100639.03c0d123@gandalf.local.home> <20220421114201.21228eeb@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 21 Apr 2022 17:27:40 +0100 Mark Rutland wrote: > We can initialize the ops pointer to a default ops that does the whole > __do_for_each_ftrace_ops() dance. OK, I think I understand now. What you are doing is instead of creating a trampoline that has all the information in the trampoline, you add nops to all the functions where you can place the information in the nops (before the function), and then have the trampoline just read that information to find the ops pointer as well as the function to call. I guess you could have two trampolines as well. One that always calls the list loop, and one that calls the data stored in front of the function that was just called the trampoline. As it is always safe to call the loop function, you could have the call call that trampoline first, set up the specific data before the function, then call the trampoline that will read it. And same thing for tear down. -- Steve