Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp452265imj; Thu, 7 Feb 2019 06:52:41 -0800 (PST) X-Google-Smtp-Source: AHgI3Iadmcd3elnlgohQepkgsS1u/lr8DW2vQaycFAxkhd/IbbIEnvLSe3d1IPwsCdY2Nd3Qclxo X-Received: by 2002:a17:902:be03:: with SMTP id r3mr16451206pls.68.1549551161727; Thu, 07 Feb 2019 06:52:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549551161; cv=none; d=google.com; s=arc-20160816; b=EZXvaCY9C5QdO05WdXl+nevkMZRcH4geYWrFgn9UNDaAXwWhPG3oD9bQ8wLyH0ZPwe dwSqjyJsne46qWPsomfk9O3ozVSGXiU0Cxvcb9fHHXsslNBWwhmmu5VH00m9LQlccsxO Yq2En4E3zyl+ugxPsIkW/d3hKi4LmcHKE6/pCU0jP9rAV/LaMIS0+1V4/88+k1Ft8O+l RqgVb3Za+7xS1vcLwwTn3HL/O7/JYgE2dQEd0k8h1WuzNC7y4T+jofP2+fqph/q9GNO8 yyjQNdo0xxEh8vFIw6vDkaDfHtFDEvC/n1kHQRxqrLfQWKXiTnmy8VljEd05CpYmRwrq Uh0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=FtRVR4fE7UxpV7OeirEobIXDwIvMSwH8aZIQs+eViVI=; b=xRAfDT1YPO31OtOuMlsMrRJRJtmbn2EqRPe38w72gx4zaveXpXL/HaVD9tniaIIgAp ER4MDglF/LaRHSpTd7PFrezCS+lOHN2sMbzajESdkyNv3f+s5i9ppOIeItFhn/HuJVa2 nm0s3RJXXuMsqn4wAQOi3fDSBdZ/e6V24LnPgK8VaW7Jw9KCMO6kEIo4yUrCFj6q8hj1 PGgCexB3RIO2k/V99xvImldX/aNOj6uIgYljk/PAoPDY/WO4fvpoDQlD9DckRWN7i/eF xLAiSb1Wa0GyZHn9XhXtDBnQ8Ju8e6CgUf/livG/zN0Oj4PaY9xsHgVYuwT9buF2Ik8F YJdg== 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 y6si9124208plk.44.2019.02.07.06.52.24; Thu, 07 Feb 2019 06:52:41 -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 S1726614AbfBGOwB (ORCPT + 99 others); Thu, 7 Feb 2019 09:52:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:41886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbfBGOwB (ORCPT ); Thu, 7 Feb 2019 09:52:01 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4C2B521872; Thu, 7 Feb 2019 14:51:59 +0000 (UTC) Date: Thu, 7 Feb 2019 09:51:57 -0500 From: Steven Rostedt To: Julien Thierry Cc: Torsten Duwe , 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: <20190207095157.3dea1086@gandalf.local.home> In-Reply-To: <198550d8-78d4-6e30-0179-b5e07dd140f8@arm.com> References: <20190118163736.6A99268CEB@newverein.lst.de> <20190118163908.E338E68D93@newverein.lst.de> <20190206150524.GA28892@lst.de> <198550d8-78d4-6e30-0179-b5e07dd140f8@arm.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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()? 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. -- Steve