Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1243957imm; Tue, 2 Oct 2018 05:18:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV61T4mLUcQoYil8SB8LpUEWDjhoQVhqGd0Hnpz5QwQKktkEC7LeolHixe1SI+0yKzJUH19Kl X-Received: by 2002:a17:902:d68e:: with SMTP id v14-v6mr554632ply.140.1538482721268; Tue, 02 Oct 2018 05:18:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538482721; cv=none; d=google.com; s=arc-20160816; b=t83LEQjmM5/3FMO9m06zn7LunHFKRuNuSEXciLkTYYzuRs3VD7fl0PLXon9ObTq1Ve z5CEBxC3DwgE3hnsbMJn09Ggg8GQm4wPN0KozEPOQaG1jKqA9OQ+moDkq7TcvyTRBXeX kUX+jd8y+ctRJU09X+GVxw1R/8BoxhN6wfN0ol+IflGS9Vow/ll70asWIUmHQTTp2Bu/ 70YGrujzgH1lBbn3oPnpg6+1LtA7Tk2B7xkMV3QdTp2k7jhsfiyWg9P3UbBgTDFCc2rm VX9YpxzIqnCZRl/JLiPlGnb8zf096N9bIQZ9/aWha7dhjEN11XjOF6MTCT9Q+qWUSwe2 o8eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WphMuE1vcxMMqNcMYVLwgtfLvOgSh37CAywTHCCLn9I=; b=dqyVkkyyP5ZH5s9/0nyubv7Urqw8XrNjZdzVvn1TFX1RtRZK0lea0TLDqzUKM9x8IE U30D+L/J+cPGWSPdXGNRyzg0SMALcb8TUJR+/FtmBMtvZ39U++YEJXsNmCHPNFqvIDo6 lR3fTHbDYkrNAVAbFBzI65f0ZBna74tZ98XOBedx8FIbdPb92qub7Zd/Gp/3Isstffgp 5kLWw2ohKADZInM0PixxDgbJnDjBqqlUPEI7TvD0QBLcA5T2lWXolQG+Ab6ybGBFqnUW F+R4ROjCBoWEf8XZa+pWJWCG83YBkwoZixu1COjQZIi6lsQUd8QBVe8981p9u6j8kTTR gI9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y125-v6si14450086pgb.14.2018.10.02.05.18.26; Tue, 02 Oct 2018 05:18:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727694AbeJBTBW (ORCPT + 99 others); Tue, 2 Oct 2018 15:01:22 -0400 Received: from verein.lst.de ([213.95.11.211]:42982 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727510AbeJBTBW (ORCPT ); Tue, 2 Oct 2018 15:01:22 -0400 Received: by newverein.lst.de (Postfix, from userid 2005) id CCF0668BDF; Tue, 2 Oct 2018 14:18:17 +0200 (CEST) Date: Tue, 2 Oct 2018 14:18:17 +0200 From: Torsten Duwe To: Mark Rutland Cc: Will Deacon , Catalin Marinas , Julien Thierry , Steven Rostedt , Josh Poimboeuf , Ingo Molnar , Ard Biesheuvel , Arnd Bergmann , AKASHI Takahiro , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v3 2/4] arm64: implement ftrace with regs Message-ID: <20181002121817.GB2398@lst.de> References: <20181001140910.086E768BC7@newverein.lst.de> <20181001141648.1DBED68BDF@newverein.lst.de> <20181002112741.mvav4ar4v25gj46e@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181002112741.mvav4ar4v25gj46e@lakrids.cambridge.arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, thank you for your very detailed feedback, I'll incorporate it all into the next version, besides one issue: On Tue, Oct 02, 2018 at 12:27:41PM +0100, Mark Rutland wrote: > > Please use the insn framework, as we do to generate all the other > instruction sequences in ftrace. > > MOV (register) is an alias of ORR (shifted register), i.e. > > mov , > > ... is: > > orr , xzr, > > ... and we have code to generate ORR, so we can add a trivial wrapper to > generate MOV. I had something similar in v2; but it was hardly any better to read or understand. My main question however is: how do you justify the runtime overhead of aarch64_insn_gen_logical_shifted_reg for every function that gets its tracing switched on or off? The result is always the same 4-byte constant, so why not use a macro and a comment that says what it does? Torsten