Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3512666imu; Mon, 14 Jan 2019 04:27:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Q/zl4p5H7aZSgoPcKPO2AbHNuxE6xdi0GA0zZafRBX8ctIdFhCxlQKGlPDnmIpOHFU6Y3 X-Received: by 2002:a17:902:bc3:: with SMTP id 61mr25313735plr.15.1547468865429; Mon, 14 Jan 2019 04:27:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547468865; cv=none; d=google.com; s=arc-20160816; b=AAVoOIseB7XX/+jZg6fN9f5FaTVqMur0hyBcj75AdH8Ero9bxlRtkh1BZvYyPaCvly Ue00EO0gFLsOlNjzHgCr+sr7ykoxTBxj2SQkFlzaRyHfkRzSYRP9E4z/NWjhn8/gip4/ SFwQ5bCco0Uyvy6nwl3fKeErDnUV2DQneg31mWXPWUok6bm+vDsG2hzYWZvyp8k0K9Lg HnAhHwtRKdzMFOAZI8Hm4MAOSFY1dyd9J7oCOP7yA1E+Z0xAmwJXatp/uxiKHUBzb6Ts Y6wiHu7+YSJMzRWork8oe21ihy8GEgBWYvqKv33nh5TryZQtBaLM6S85B2fFRCoT6ANA fFgg== 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=3NAbqbaP2HTcg1WOkff6ZTugbiE/iaTC6bCnmuv0axY=; b=F0dSBhVcIP0elz53lljHJzZpH0PGEyswjekDNmKpCt5AwB0TR39XSp2J0l5XZ3JhR0 sS1Rxia5c24lGGVZwIppt6mY9djJIUXUlx+hIhxx5fkWlwGClqfVVijvB70wfgbA9Vl4 5ahIro6tMt9QASaPPmOKDi/b3aWtKK/6zQ/2w+6on2HSrKpvRKfqhLhuR+OuZcWLN+6S C+VDFT5n892CwaoUAnlcAuwaZsqRQTS6RNhtrgA2t2ZHO+7byUaOYuOOLJQgXZ/Uo4r+ UhDVwjeCJDKLIGFX+/O7QFY+hMXMkmImURJX5H/qezr/opZhJiKchXGyx+1q200OM04r vUAA== 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 g26si257154pfe.127.2019.01.14.04.27.29; Mon, 14 Jan 2019 04:27:45 -0800 (PST) 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 S1726646AbfANM0Y (ORCPT + 99 others); Mon, 14 Jan 2019 07:26:24 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60816 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbfANM0W (ORCPT ); Mon, 14 Jan 2019 07:26:22 -0500 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 C929680D; Mon, 14 Jan 2019 04:26:21 -0800 (PST) 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 4AAE53F5BD; Mon, 14 Jan 2019 04:26:19 -0800 (PST) Date: Mon, 14 Jan 2019 12:26:16 +0000 From: Mark Rutland To: Balbir Singh Cc: Torsten Duwe , Will Deacon , Catalin Marinas , Julien Thierry , Steven Rostedt , Josh Poimboeuf , Ingo Molnar , Ard Biesheuvel , Arnd Bergmann , AKASHI Takahiro , Amit Daniel Kachhap , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v6] arm64: implement ftrace with regs Message-ID: <20190114122616.GD10258@lakrids.cambridge.arm.com> References: <20190104141053.360F768D93@newverein.lst.de> <20190104175017.GA7157@lakrids.cambridge.arm.com> <20190114121359.GB26056@350D> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190114121359.GB26056@350D> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 14, 2019 at 11:13:59PM +1100, Balbir Singh wrote: > On Fri, Jan 04, 2019 at 05:50:18PM +0000, Mark Rutland wrote: > > Hi Torsten, > > > > On Fri, Jan 04, 2019 at 03:10:53PM +0100, Torsten Duwe wrote: > > > Use -fpatchable-function-entry (gcc8) to add 2 NOPs at the beginning > > > of each function. Replace the first NOP thus generated with a quick LR > > > saver (move it to scratch reg x9), so the 2nd replacement insn, the call > > > to ftrace, does not clobber the value. Ftrace will then generate the > > > standard stack frames. > > Do we know what the overhead would be, if this was a link time change > for the first instruction? No, but it should be possible to benchamrk that for a given workload, which is what I'd like to see. > Also, I was under the impression that some arch's do ftrace_call_replace > under stop_machine(), is that a possibility here? Something like that is a possibility. I think we need numbers either way. Thanks, Mark.