Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1282981imm; Tue, 2 Oct 2018 05:58:07 -0700 (PDT) X-Google-Smtp-Source: ACcGV61toJvcxuQXPOwaT3B0gL2OVVHk4qNTAPg53gr6+viOL1+uwnNuIybh4/VWk0oUhV53lKuJ X-Received: by 2002:a62:d40d:: with SMTP id a13-v6mr16430865pfh.23.1538485087261; Tue, 02 Oct 2018 05:58:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538485087; cv=none; d=google.com; s=arc-20160816; b=FpQImN849VXFVP8XkTLRvjncGxNSrplXynZs77suhGdqN/t5amjF6WIjKcZMvyIhXv ZKL7INjYBACMHBr9U1uE8Olp36twAwJ2u3lkpQ+e34aOJNiaZQlxdYKyFMt6TCFrP7wD qZ/TrczUc8G9I2LTJ6Kr1uyDwmwEXRaXKr+VQkIhrW+2+NCEW7vCaKVI8GcknDItK81+ wQ0E0DEan+egGYj/NrfhZLCUPLu30gnpFczbbtk7n3gg4Tu8HVFAqu760NC59iH4Nnw1 2oDA1s41Rq9gtIwAlGCSBw0ZEe1iawsaK0iKE5aMNHt8tc7LzfDj5sEowRfa8f3Xv01f olSA== 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=NLoUQ0x3qjrpxzje9sDOl6DjLysNJ2FkeJhIq4IPSYg=; b=o1DCGTsjWRNzTNlnFQEXLy1tinrDbkEYOPDDwS8r/NS0U0rzxXLuR2U7MMCbamtapp DPz1h7MhnizQHvzZKJR4SSsv7LFoHmCMIuNn2NPUaUV5njDzUd8gA7HAvu6uaKs9rUZ1 F3CzN8CCRvKHishw9/zuucC00wJtKVyzugWUfEP/ZsbCGmbuyTGZyzGHvxe/mZXTKm3/ RsSZRA0rYcngDW+nrP1SNvJVcQBrtnTucfyiUm8gskUNYU8hl+zNGQKj/ZHHO+JlPGwh P7pkqdP36sTcdefDHPTvb1d7/UL0h7geGMM7a+LVv4gyYXIQ16IkhIYJR5UhZwst+MYU c9dQ== 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 b10-v6si16574914pfb.89.2018.10.02.05.57.52; Tue, 02 Oct 2018 05:58:07 -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 S1727822AbeJBTkw (ORCPT + 99 others); Tue, 2 Oct 2018 15:40:52 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36762 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727742AbeJBTkw (ORCPT ); Tue, 2 Oct 2018 15:40:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 69CC77A9; Tue, 2 Oct 2018 05:57:39 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1F0063F5B7; Tue, 2 Oct 2018 05:57:36 -0700 (PDT) Date: Tue, 2 Oct 2018 13:57:34 +0100 From: Mark Rutland To: Torsten Duwe 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: <20181002125734.mhkz4o46oxf3mtu6@lakrids.cambridge.arm.com> References: <20181001140910.086E768BC7@newverein.lst.de> <20181001141648.1DBED68BDF@newverein.lst.de> <20181002112741.mvav4ar4v25gj46e@lakrids.cambridge.arm.com> <20181002121817.GB2398@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181002121817.GB2398@lst.de> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 02, 2018 at 02:18:17PM +0200, Torsten Duwe wrote: > Hi Mark, Hi, > 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? How do you justify doing something different from the established pattern? Do you have any numbers indicating that this overhead is a problem on a real workload? For the moment at least, please use aarch64_insn_gen_*(), as we do for all other instructions generated in the ftrace code. It's vastly simpler for everyone if we have consistency here. > The result is always the same 4-byte constant, so why not use a macro > and a comment that says what it does? I'd rather that we stick to the usual pattern that we have in arm64. Note that aarch64_insn_gen_nop() also always returns the same 4-byte constant, but it's an out-of-line function in insn.c. There haven't been any complaints as to its overhead so far... Thanks, Mark.