Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp463416imj; Thu, 7 Feb 2019 07:02:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IYWpXyXLPm4OpXjA9+XkEr062CuMhOxfWfLJ1ol+hASy0mSRUx9PCkT8XdV4Rsy9vGdTQ/q X-Received: by 2002:a62:2781:: with SMTP id n123mr16748462pfn.138.1549551747014; Thu, 07 Feb 2019 07:02:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549551747; cv=none; d=google.com; s=arc-20160816; b=Abi52u5URuKCXvfRx003NlCwm755kI4mVrgvjKgM2x8zAM7fxBDZr0vC3ztRatpjTb QRDVBrChKrhU8k7QQ7WoSu/MCKuCFnVgyIS0QTQ2BiF7UBZpuLJETc6fuDYsP3r+9F/f Jx/b/1akfL6N52X22Y/J2Nz7oyFscCnvYTH5Bg2WsKdHGQo5QtAyviSPxuBxCK+sqKSV tqAEIXeBz5rJ1r0Fp7rroeAup3EClbLsFTvjSnf+PL2VqkFLXTC+7UKAjMQ6MjFrNgVa iW1jtcF9vuloVFDP1VJoMXb5vrKJ2zMknTxL/vlkByFRZmwfeyEcE00VlIcgl2wToNfe Jadw== 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=+O5wNyX/ZEAn5a9T8AXblNp/604m3uh1drFsiu06f7g=; b=KKXaKmTjM8A3JiNp4L/tFHB3BTaaVD28IPq5HSv8y8GByF4MB321v753yLumYyirt3 Xc/kcoYx98rDNAxdEZEMlcMNc5ZcRJiN9iKyFIdnzXW3p4RNJDI1KPI8S6SW60A0GbBU /XlSPlzZY1rMVk/nHYq8qD8d7Vxp+a1y4yEk35VtCTH/2vd5OrXHD3ws/klJEQ9ySTW5 N80gcFzkKcNQiDhllvFczTCP9BobyVMMsRv4fUIXvPJgoov0Y/DIlQ/WbCK/27b0Y6wy 5exThOZHHdIRq6BoQJmcKyl7aGIgy3Sk26B8IUWhzdDXS9sQ4TXM2Yw31fEPKndJsMTZ iRgQ== 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 q8si4493456pll.1.2019.02.07.07.02.07; Thu, 07 Feb 2019 07:02:27 -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 S1726728AbfBGPAc (ORCPT + 99 others); Thu, 7 Feb 2019 10:00:32 -0500 Received: from verein.lst.de ([213.95.11.211]:37235 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbfBGPAb (ORCPT ); Thu, 7 Feb 2019 10:00:31 -0500 Received: by newverein.lst.de (Postfix, from userid 2005) id 419F568C8E; Thu, 7 Feb 2019 16:00:29 +0100 (CET) Date: Thu, 7 Feb 2019 16:00:29 +0100 From: Torsten Duwe To: Steven Rostedt Cc: Julien Thierry , Mark Rutland , Will Deacon , Catalin Marinas , 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 v7 2/3] arm64: implement ftrace with regs Message-ID: <20190207150029.GB19818@lst.de> References: <20190118163736.6A99268CEB@newverein.lst.de> <20190118163908.E338E68D93@newverein.lst.de> <20190206150524.GA28892@lst.de> <198550d8-78d4-6e30-0179-b5e07dd140f8@arm.com> <20190207095157.3dea1086@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190207095157.3dea1086@gandalf.local.home> 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 On Thu, Feb 07, 2019 at 09:51:57AM -0500, Steven Rostedt wrote: > On Thu, 7 Feb 2019 10:33:50 +0000 > Julien Thierry wrote: > > > I don't see really much documentation on that function. As far as I can > > tell it is only called once for each site (and if it didn't, we'd always > > be placing the same instruction, but I agree it wouldn't be nice). It > > could depend on how far you can expand the notion of "adjusting" :) . > > > > Steven, do you have an opinion on whether it would be acceptable to > > modify function entry code in ftrace_call_adjust() ? > > Just to make sure I'm on the same page as you are. You want to modify > the function entry code at the time of the ftrace_call_adjust()? Yes, this was the fiendish plan ;-) > I would update the rec->ip to the offset you want at > ftrace_call_adjust() but not do any modifications. It really isn't safe > to do it there. But right after that is called, you will have the arch > specific call of ftrace_make_nop() called with MCOUNT_ADDR as the > second parameter to let you know that this is the first time the call > is made at this address. This is where you can do that initial > modifications. Ok, so just substitute REC_IP_BRANCH_OFFSET arithmetic with ftrace_call_adjust() and keep the MCOUNT_ADDR logic. Thanks for the clarification. Torsten