Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7104118rwb; Tue, 15 Nov 2022 07:44:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf4QUWRKgPlI8bqF0GjcYG7s7wrgwfD41i6dmwJJgLl3bKlzV3TICmYo3I9qkxlzpALvdne4 X-Received: by 2002:a17:90b:3758:b0:212:f923:2f90 with SMTP id ne24-20020a17090b375800b00212f9232f90mr2775723pjb.93.1668527095729; Tue, 15 Nov 2022 07:44:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668527095; cv=none; d=google.com; s=arc-20160816; b=cbzGoD39A6YM/PFNnXWn74TbtPKEMAZ0g4bbXh9clZpgzIb5CYb2kh4FrRfD0Qv8pu T2T3scXTsQmbFSveAniSjuOkLWYRoelLti8ZhKgcfFYcki6RdtatlbNqV8sdk7AqSKvt UZG8l9ZwuXF8N8i9yboT4zvltrS+HrmUFZ1qbxghvgnWR6aRbYnDrpChiGIh9uUyYrhP KIZDWgI/zKyDZKQyDYlcRdqUeFztE8P965Cm423QoRmkeOaaeoombh2a68NqPRuO++a+ yXz0m3Pi2aFm7cwPE7LiGzh0t74bbPhkDRY2ZGNUwhsY3/9NLHwH2tblQj5RcezBDsky 2kGg== 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=YDo7ldlOpBHDuFaEkIIE6MOzwo3Ap16oiWUe4ec+6XM=; b=zBZKTXjvSWRR9cM8Z0x7Gq5bTfkkAVl+mk0kIiEDtQN+3GbBvpuKd9jawCqXlgGUZO Norfi95L2bWRdVe9MTVRG0sZknpo8SqM43OJ3Tcen9JcEJzhJi/SeWnCp6lJ8PMMsE2y 5YiMgBR/fkZVwyAyNx5UY/qHQhcoqgyD7bfCf8tPYQ5aHuhgmnMAMc4U73KmFrM6YCgd S7m5WE/U8hX1aAAp6bZE7B3EtjLxwV2cYiw1BvBOD2VnTcgc/JMHL5IHoglG+uxguEhH 98hIsxieZnTU69PINvRT3Poc6PbqOV5k1IlKnueQqx4UwbVTIlg54wTpGW0f+70obdXm tNyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 197-20020a6303ce000000b00462566bfda3si12110935pgd.643.2022.11.15.07.44.43; Tue, 15 Nov 2022 07:44:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbiKOPBO (ORCPT + 90 others); Tue, 15 Nov 2022 10:01:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiKOPBM (ORCPT ); Tue, 15 Nov 2022 10:01:12 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08AAC248E2 for ; Tue, 15 Nov 2022 07:01:09 -0800 (PST) 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 A8CFEB81923 for ; 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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, 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