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 8A796C433FE for ; Tue, 15 Nov 2022 15:50:25 +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:In-Reply-To:MIME-Version:References: 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=pGJjr50sczcvceqRfXfxZdyKc0NX8riD2GouUsS4ENM=; b=3B8Yf/7f/t7nhH 8hQDPsNR7vzS/+iMbtiMlNFe4D4mylobaFSuqKbavf9PiTVSYCCROB/Ywqqy0N0pnpXr8QygDA4Sr +sMrNXOQXii2ggZohfUdZZl0ai4+U0ljrNqonsJWfl1BhlJNZTivoKeG6HRoUF8ii/5Hs7LMotiom ykHGmCk2cfI1sueEbcjaQZHjEPJmUAOBr7fyUoqTDGMjV64gatxAu2uT76I22Vxl5zYMrZ1POG31i zrgt/xy8jHG34Ii3KdkkMPmHNH/pELPtynQEew7IsHdm1lJbgXHz1pFso0vPs/w/Dlc4D6GK2Oyzw 7k8EzQhuMCWBd4K4k57A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouyBc-00CSbK-E3; Tue, 15 Nov 2022 15:49:20 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouyBH-00CSWP-35 for linux-arm-kernel@lists.infradead.org; Tue, 15 Nov 2022 15:49:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A80BD13D5; Tue, 15 Nov 2022 07:49:02 -0800 (PST) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.33.161]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 54E6A3F587; Tue, 15 Nov 2022 07:48:55 -0800 (PST) Date: Tue, 15 Nov 2022 15:48:49 +0000 From: Mark Rutland To: Steven Rostedt 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: References: <20221103170520.931305-1-mark.rutland@arm.com> <20221115100148.08475da0@gandalf.local.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221115100148.08475da0@gandalf.local.home> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221115_074859_276032_CF316D75 X-CRM114-Status: GOOD ( 29.00 ) 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 Tue, Nov 15, 2022 at 10:01:48AM -0500, Steven Rostedt wrote: > 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? Ah; sorry, I had meant to include the results here. With this series applied atop v6.1-rc4 and using the ftrace selftests from that tree, my results were the same as with baseline v6.1-rc4: | # of passed: 104 | # of failed: 0 | # of unresolved: 7 | # of untested: 0 | # of unsupported: 2 | # of xfailed: 1 | # of undefined(test bug): 0 Where the non-passing tests were: | [8] Test ftrace direct functions against tracers [UNRESOLVED] | [9] Test ftrace direct functions against kprobes [UNRESOLVED] ... as direct functions aren't supported on arm64 (both before and after this series). | [16] Generic dynamic event - check if duplicate events are caught [UNSUPPORTED] | [74] event trigger - test inter-event histogram trigger eprobe on synthetic event [UNSUPPORTED] ... which are due to a bug in the tests fixed by: https://lore.kernel.org/all/20221010074207.714077-1-svens@linux.ibm.com/ ... and they both pass with that applied. | [22] Test trace_printk from module [UNRESOLVED] | [31] ftrace - function trace on module [UNRESOLVED] | [51] Kprobe dynamic event - probing module [UNRESOLVED] | [61] test for the preemptirqsoff tracer [UNRESOLVED] ... which are because my test environment didn't have modules. | [62] Meta-selftest: Checkbashisms [UNRESOLVED] ... which is irrelevant for this series. | [65] event trigger - test inter-event histogram trigger expected fail actions [XFAIL] ... which is expected. [...] > 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) Thanks! Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CF78C433FE for ; Tue, 15 Nov 2022 15:54:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230491AbiKOPtI (ORCPT ); Tue, 15 Nov 2022 10:49:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbiKOPs6 (ORCPT ); Tue, 15 Nov 2022 10:48:58 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ED0E32E9 for ; Tue, 15 Nov 2022 07:48:56 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A80BD13D5; Tue, 15 Nov 2022 07:49:02 -0800 (PST) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.33.161]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 54E6A3F587; Tue, 15 Nov 2022 07:48:55 -0800 (PST) Date: Tue, 15 Nov 2022 15:48:49 +0000 From: Mark Rutland To: Steven Rostedt 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: References: <20221103170520.931305-1-mark.rutland@arm.com> <20221115100148.08475da0@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221115100148.08475da0@gandalf.local.home> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 15, 2022 at 10:01:48AM -0500, Steven Rostedt wrote: > 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? Ah; sorry, I had meant to include the results here. With this series applied atop v6.1-rc4 and using the ftrace selftests from that tree, my results were the same as with baseline v6.1-rc4: | # of passed: 104 | # of failed: 0 | # of unresolved: 7 | # of untested: 0 | # of unsupported: 2 | # of xfailed: 1 | # of undefined(test bug): 0 Where the non-passing tests were: | [8] Test ftrace direct functions against tracers [UNRESOLVED] | [9] Test ftrace direct functions against kprobes [UNRESOLVED] ... as direct functions aren't supported on arm64 (both before and after this series). | [16] Generic dynamic event - check if duplicate events are caught [UNSUPPORTED] | [74] event trigger - test inter-event histogram trigger eprobe on synthetic event [UNSUPPORTED] ... which are due to a bug in the tests fixed by: https://lore.kernel.org/all/20221010074207.714077-1-svens@linux.ibm.com/ ... and they both pass with that applied. | [22] Test trace_printk from module [UNRESOLVED] | [31] ftrace - function trace on module [UNRESOLVED] | [51] Kprobe dynamic event - probing module [UNRESOLVED] | [61] test for the preemptirqsoff tracer [UNRESOLVED] ... which are because my test environment didn't have modules. | [62] Meta-selftest: Checkbashisms [UNRESOLVED] ... which is irrelevant for this series. | [65] event trigger - test inter-event histogram trigger expected fail actions [XFAIL] ... which is expected. [...] > 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) Thanks! Mark.