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 628B8C433FE for ; Tue, 15 Nov 2022 11:28:11 +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=x5MsJzU7vPG3ee5HOLICkfaAJXy5RApkIt9oELmPSS8=; b=WjjJPuy9KtLxUs +tbWYClTUNGtYX8H69dwdLoaPv2TPYWP3VJEcaVQtEV5POS+rERyjen9lZPsMiAr/3cNY2uwSZs+7 aQimaep2enWL5zTUSoJywzVIr+Cm9FU0Jtl1ISYIJD2cAwm/oaThjHW2/DNU+cqMFcyWDZUcozxkz YabMFVMU6d94dbrwFrvQHjDvvbbQU3C44gAVjtraivnpOe9ibkTuhA0OBmS4sqAN6vBveW/aSoElY 3M6hIPWvTR2GeukTYAIV4d3HhXWbGIX1GXm484GeAjb5dzIqmExLgpuxOqpEx3FXomJ7MJVc4Uc18 qA3AhFXMZKZmTgt7mfzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouu5w-00Ab6g-3v; Tue, 15 Nov 2022 11:27:12 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouu5t-00Ab5k-F4 for linux-arm-kernel@lists.infradead.org; Tue, 15 Nov 2022 11:27:10 +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 dfw.source.kernel.org (Postfix) with ESMTPS id D0808616B5; Tue, 15 Nov 2022 11:27:08 +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-Disposition: inline In-Reply-To: <20221103170520.931305-5-mark.rutland@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221115_032709_560456_5B90DFE9 X-CRM114-Status: GOOD ( 16.92 ) 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, 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel