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 EC14CC4332F for ; Tue, 15 Nov 2022 15:02:57 +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=DzbDOr4RTzvxCESJ9UVuAlZ+6rQBoRpZ+fNK0LKBDPY=; b=cFYgDnlPpQXhXh BNb1WF25W5T0JUxyylWWiJ/BgU+8yTGRldOyshtGY2EFTCRDcL/RCzyEittQG8nM1rkZYVeo+SAeM NgTAYpfn+7AEQeGgVNIuynFUmX+wPCTVEZzVaH7S4UDdK0VrN6TPy0wnrHY14R+ebZNLcpOT47h0T nYsG9s/efUIb+dg009NyQwNRpVMmBjAjk3U3kua++CnpIPzZWdecxV16X6GFmxqPUGOQmAvfoznhU H6tXr90E5Sg50+JWUCUXlZH2ovCaKXzcEOAOmYCSqb+pC8V+ARUOH8wb3eGQyoHoPu0/egfzXNcWL GOlE5zJgoimju6+qmk1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouxR6-00C8RL-Uu; Tue, 15 Nov 2022 15:01:17 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouxQz-00C8Ob-Rk for linux-arm-kernel@lists.infradead.org; Tue, 15 Nov 2022 15:01:11 +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 A105FB81990; Tue, 15 Nov 2022 15:01:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97CEFC433D6; Tue, 15 Nov 2022 15:01:05 +0000 (UTC) Date: Tue, 15 Nov 2022 10:01:48 -0500 From: Steven Rostedt To: Mark Rutland Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, mhiramat@kernel.org, revest@chromium.org, will@kernel.org Subject: Re: [PATCH v2 0/4] arm64/ftrace: move to DYNAMIC_FTRACE_WITH_ARGS Message-ID: <20221115100148.08475da0@gandalf.local.home> In-Reply-To: <20221103170520.931305-1-mark.rutland@arm.com> References: <20221103170520.931305-1-mark.rutland@arm.com> 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-20221115_070110_150669_C2B6BDB6 X-CRM114-Status: GOOD ( 28.85 ) 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, 3 Nov 2022 17:05:16 +0000 Mark Rutland wrote: > This series replaces arm64's support for FTRACE_WITH_REGS with support > for FTRACE_WITH_ARGS. This removes some overhead and complexity, and > removes some latent issues with inconsistent presentation of struct > pt_regs (which can only be reliably saved/restored at exception > boundaries). > > The existing FTRACE_WITH_REGS support was added for two major reasons: > > (1) To make it possible to use the ftrace graph tracer with pointer > authentication, where it's necessary to snapshot/manipulate the LR > before it is signed by the instrumented function. > > (2) To make it possible to implement LIVEPATCH in future, where we need > to hook function entry before an instrumented function manipulates > the stack or argument registers. Practically speaking, we need to > preserve the argument/return registers, PC, LR, and SP. > > Neither of these requires the full set of pt_regs, and only requires us > to save/restore a subset of registers used for passing > arguments/return-values and context/return information (which is the > minimum set we always need to save/restore today). > > As there is no longer a need to save different sets of registers for > different features, we no longer need distinct `ftrace_caller` and > `ftrace_regs_caller` trampolines. This allows the trampoline assembly to > be simpler, and simplifies code which previously had to handle the two > trampolines. > > I've tested this with the ftrace selftests, where there are no > unexpected failures. Were there any "expected" failures? > > I plan to build atop this with subsequent patches to add per-callsite > ftrace_ops, and I'm sending these patches on their own as I think they > make sense regardless. > > Since v1 [1]: > * Change ifdeferry per Steve's request > * Add ftrace_regs_query_register_offset() per Masami's request > * Fix a bunch of typos > > [1] https://lore.kernel.org/lkml/20221024140846.3555435-1-mark.rutland@arm.com > > This series can be found in my 'arm64/ftrace/minimal-regs' branch on > kernel.org: > > https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/ > git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git > > This version is tagged as: > > arm64-ftrace-minimal-regs-20221103 So I ran this on top of my code through all my ftrace tests (for x86) and it didn't cause any regressions. Reviewed-by: Steven Rostedt (Google) -- Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel