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 64595C61DA4 for ; Fri, 3 Feb 2023 10:04:51 +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=TfJaTckPeIxb11eJtC8irht6bCJq6XKGEw4hRJwXw2E=; b=NUoT3iAkSOGwzZ YYnkwyp/v0EG32D0C0kXZM79aWSmrbzhZxiAHEgHb5JoYQ9AdaD+2/pEahjmjmEOWTG86aVZlugmq Dkh0+Nly65DeNNoU+F2WcWHxXvmuHTDfRvO9pQoA+/8C0aYTocnpVgiAjrsIYTLtzqXPT8N9RxaUU gmFcKusZLzVnPZQdlSY0beLWgyhgOUkM6/WpWcI7Wo1IYDfnMamqxBeIj4B5LRuiiwi7OJdsRqxm2 H75vHi2UAL8aacCfeYETPn6aPFYtYI1767UZ2Yt+Sr10lhvEPn4S5HdhcqIWWrqWsgsPKGlhJeRf3 Li7SfAJ/VdFA3xKObOPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNsvB-001Ijl-Mx; Fri, 03 Feb 2023 10:03:53 +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 1pNsv5-001Ihd-9z for linux-arm-kernel@lists.infradead.org; Fri, 03 Feb 2023 10:03:51 +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 D936BC14; Fri, 3 Feb 2023 02:04:25 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.90.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6B2013F8D6; Fri, 3 Feb 2023 02:03:41 -0800 (PST) Date: Fri, 3 Feb 2023 10:03:38 +0000 From: Mark Rutland To: Florent Revest Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, rostedt@goodmis.org, mhiramat@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kpsingh@kernel.org, jolsa@kernel.org, xukuohai@huaweicloud.com Subject: Re: [PATCH 5/8] ftrace: Make DIRECT_CALLS work WITH_ARGS and !WITH_REGS Message-ID: References: <20230201163420.1579014-1-revest@chromium.org> <20230201163420.1579014-6-revest@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230203_020347_410283_B53CCE70 X-CRM114-Status: GOOD ( 17.90 ) 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, Feb 02, 2023 at 07:19:58PM +0100, Florent Revest wrote: > On Thu, Feb 2, 2023 at 5:57 PM Mark Rutland wrote: > > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > > index 84f717f8959e..3d2156e335d7 100644 > > --- a/include/linux/ftrace.h > > +++ b/include/linux/ftrace.h > > @@ -241,6 +241,12 @@ enum { > > FTRACE_OPS_FL_DIRECT = BIT(17), > > }; > > > > +#ifndef CONFIG_DYNAMIC_FTRACE_WITH_ARGS > > +#define FTRACE_OPS_FL_SAVE_ARGS FTRACE_OPS_FL_SAVE_REGS > > +#else > > +#define FTRACE_OPS_FL_SAVE_ARGS 0 > > Mh, could we (theoretically) be in a situation where an arch supports > WITH_ARGS but it also has two ftrace_caller trampolines: one that > saves the args and the other that saves nothing ? (For example if x86 > migrates their WITH_REGS to WITH_ARGS only) I don't think so -- the point of WITH_ARGS is that we always have to save/restore the args, and when WITH_ARGS is selected they're unconditionally available (though not necessarily a full pt_regs), which is what other code assumes when WITH_ARGS is selected. > Wouldn't it make sense then to define FTRACE_OPS_FL_SAVE_ARGS as an > extra bit to tell ftrace that we need the args, similarly to > FTRACE_OPS_FL_SAVE_REGS ? > > If that can't happen or if we want to leave this up for later, the > patch lgtm and I can squash it into my patch 5 in v2. ;) I think that can't happen, and for now the above should be fine. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel