Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6773031rwb; Tue, 15 Nov 2022 03:35:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf79GAdp/+/kW/G7dGn6byTHT26rTU3GsVjbpDwLQBWRXRS/evl48y71NnIP3M6KUJ9DNkbM X-Received: by 2002:a17:902:e809:b0:17c:f013:8fae with SMTP id u9-20020a170902e80900b0017cf0138faemr3646245plg.138.1668512138159; Tue, 15 Nov 2022 03:35:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668512138; cv=none; d=google.com; s=arc-20160816; b=WIB+uVOJnHMZVR58t0IHPb7Rc9fVj2oLkX+QXSJmW2w87g7nvA4/WXowGZ1nlLYONX K1b7PILKQj0kKVi6K0cO/n6pUmaBsiv8od9e0owJmzjOERUtRvcv4jw41h3hdIJ/EKaX H/BBzq37+ccET9HWi1yIARt93Jin0h0KmmGtVvnS0oWTEwN2bJmvI9RDDCy7T6GhdyvZ 1GAPny4QVToCPXaj64s8lZ43/oJXw52g2tyUxvUGBrUjuSD8v8nONa5VkUcJobGUVIU/ ytaZWnFKXbDPUzRjNCGun+odCYM5KlTOMHptDoUvZS9xlslskd2wWAW9yNi0RzrNYUdy w6eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=06Q9HQz2ndqvP5hZAZeiqXwer0LZ4FJFOHxKQkpyTTc=; b=Lhepd+jEk+IyJhnrI8uiwrG6dtdZ2VsAfn0wAUaT1v6egJVNvAfIkfC3saAr+jQKtq x5Jzwph6ox2xX0lHgdnqlSvZj0ljhpLH4NVK9pErZAkbLdL9+6tFypNndWVHpm27XE5w KSS68ftd6w/WmI26s/Zr/u0/BhZQLCSSK+d1O/qD8l8rF6g8FFwatfGI/SltWWpgkzR3 JBqL6DCzeO9+Gv4vUZ+cSG1KnQIB/x7LbRGkIC66PyZUqPCXmqams8fv/o4YRrJUy0mo bUwCTVUbvc1kqWxHv+EpPLE+FOBxgUyThqCfiDnDHtAGftf9iytMtBJrpgw4Y1v4FBhr N/wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FWvNR++Q; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il7-20020a17090b164700b00213d512f07csi13277327pjb.182.2022.11.15.03.35.25; Tue, 15 Nov 2022 03:35:38 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FWvNR++Q; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230254AbiKOL1O (ORCPT + 89 others); Tue, 15 Nov 2022 06:27:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbiKOL1M (ORCPT ); Tue, 15 Nov 2022 06:27:12 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D79C723BF1 for ; Tue, 15 Nov 2022 03:27:10 -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 95862B8165D for ; Tue, 15 Nov 2022 11:27:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCF61C433D7; Tue, 15 Nov 2022 11:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668511628; bh=K8GH84ufCawCbSPwuVXmJl8pj/woWabJOKnWxinVgow=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FWvNR++QQwgLMRZ04m1WEHvsU5z3xS/M+Q1Wjug70qp3KGGit2FwhMRkj0Xy6Q3ni wVlRag7iXtDDiVsX7XJ5PeQUnsHpA4SHHq+wkpZWc/HLWoK7YBcVm7axiWfYoGNcbM vGrQlMSJIDU9ng1akJ1KDntvbW6lZL0fYqujnr+I6xhPH0KWkX/jC7wIvqcCiR8ytD dofDNnK/Hqh0BosoIq8NPMXbDoFE6FI3gDQIln8bbG3sjQPjISCglC91L5g9jpxDwt QUBvOLPrTpbkAEioZyMcorNG89zBmjK6MVuHz5CgpWJPMZI11K9Sxa6cPqlSJXAOgl K8XV2yhZv5zcQ== Date: Tue, 15 Nov 2022 11:27:03 +0000 From: Will Deacon 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, rostedt@goodmis.org Subject: Re: [PATCH v2 4/4] ftrace: arm64: move from REGS to ARGS Message-ID: <20221115112701.GB32523@willie-the-truck> References: <20221103170520.931305-1-mark.rutland@arm.com> <20221103170520.931305-5-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221103170520.931305-5-mark.rutland@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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, Nov 03, 2022 at 05:05:20PM +0000, Mark Rutland wrote: > This commit 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). [...] > @@ -78,10 +77,71 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr) > return addr; > } > > -#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS > +#ifdef CONFIG_DYNAMIC_FTRACE_WITH_ARGS > struct dyn_ftrace; > struct ftrace_ops; > -struct ftrace_regs; > + > +#define arch_ftrace_get_regs(regs) NULL > + > +struct ftrace_regs { > + /* x0 - x8 */ > + unsigned long regs[9]; > + unsigned long __unused; > + > + unsigned long fp; > + unsigned long lr; > + > + unsigned long sp; > + unsigned long pc; > +}; > + > +static __always_inline unsigned long > +ftrace_regs_get_instruction_pointer(const struct ftrace_regs *fregs) > +{ > + return fregs->pc; > +} > + > +static __always_inline void > +ftrace_regs_set_instruction_pointer(struct ftrace_regs *fregs, > + unsigned long pc) > +{ > + fregs->pc = pc; > +} > + > +static __always_inline unsigned long > +ftrace_regs_get_stack_pointer(const struct ftrace_regs *fregs) > +{ > + return fregs->sp; > +} > + > +static __always_inline unsigned long > +ftrace_regs_get_argument(struct ftrace_regs *fregs, unsigned int n) > +{ > + if (n < 8) > + return fregs->regs[n]; Where does this '8' come from? Will