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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD673C433FE for ; Thu, 21 Apr 2022 17:07:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+nLXZ3NPS4DejFsR1I6/oOhnBvhlKBHvIXsRYDxMHUo=; b=PQd/ouliBZPeav CiCfatiX+DQbFDVmXr7LIKcN+rICY/XGng5Os+R9ulXUtrZWQMpcaojAokw9lEl/Z+r+0F56z+e6W ZSlYn5hsvDTkVOLI/VFA2FCLauprXgk0FmfdYO5osflk4XR1VbmEhs9JNUQ3RqzdQZg+QbEGCxOk8 Zup35bn5EvjpJKgfxLo+sHFk/Ha2i6ZgDl+lOu33JFqJfo+AuFHIeh4IEsCGaE5VBFuMz0LBvF29m yCjfvFTZty+fDidWeu277UmjR8TjdaonseafWYFegaf37tHbU3ZgnssdWg7wcqE4cq546TI3Bp4AZ a19qtPEd4u2NY2ZwQ6uA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhaGf-00EO0N-Mh; Thu, 21 Apr 2022 17:06:57 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhaGc-00ENze-7U for linux-arm-kernel@lists.infradead.org; Thu, 21 Apr 2022 17:06:55 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id A8282B82779; 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220421_100654_459240_624F268F X-CRM114-Status: GOOD ( 14.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel