From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13FBDC4332F for ; Mon, 7 Nov 2022 15:33:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FJqMe7mzwtmwrLBSlClD0GrRmbOx3skDIaFV0bUga6w=; b=h7EzUW2xpX+M7F 4zmeoA0+UzFapVJHZObC1QjTWCJXJ0mu4yg+IRdEmQ1EusamKTclRaKCn81x92RgLsFcnkO5KFe34 h9ARxF0WhXAnzFKLx/RhklXB2V/iIYr6oIdHOOUug6LIVXk8C/IreMggG1BxkQ83hv0LUNsVQ8xnL eWgFCvTPnnMYfpHnx9Mul+XNN27XeJfQDOYileLhu/fWt7WvvZPVaRsTFdeZk57qC7y77xzHL7MCH Km8dQEnTQGO15Q0YGi212K7y4pmJqDmK235a7FNUdYJRoa4XjbuM7/8NcBmAxjB/zMAa+5NJrNjVo 555ON2kn6VCC6p6Ja3kQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1os476-00FkzV-Ew; Mon, 07 Nov 2022 15:32:40 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1os472-00Fkyj-Jf for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 15:32:38 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C74EB1FB; Mon, 7 Nov 2022 07:32:38 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.69.132]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3BE3F3F73D; Mon, 7 Nov 2022 07:32:30 -0800 (PST) Date: Mon, 7 Nov 2022 15:32:24 +0000 From: Mark Rutland To: Will Deacon Cc: Jianlin Lv , corbet@lwn.net, catalin.marinas@arm.com, rostedt@goodmis.org, mingo@redhat.com, naveen.n.rao@linux.ibm.com, anil.s.keshavamurthy@intel.com, davem@davemloft.net, mhiramat@kernel.org, arnd@arndb.de, zhengzengkai@huawei.com, jianlv@ebay.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64/kprobes: Add support for KPROBES_ON_FTRACE Message-ID: References: <20220728020250.1699-1-iecedge@gmail.com> <20221107144931.GA20793@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221107144931.GA20793@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221107_073236_712657_EC1333D4 X-CRM114-Status: GOOD ( 17.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Nov 07, 2022 at 02:49:31PM +0000, Will Deacon wrote: > [+Mark R] > > On Thu, Jul 28, 2022 at 02:02:50AM +0000, Jianlin Lv wrote: > > This is the arm64 version of ftrace-based kprobes to avoid the overhead > > with regular kprobes, by using the ftrace infrastructure. > > > > Signed-off-by: Jianlin Lv > > --- > > .../debug/kprobes-on-ftrace/arch-support.txt | 2 +- > > arch/arm64/Kconfig | 1 + > > arch/arm64/kernel/probes/Makefile | 1 + > > arch/arm64/kernel/probes/kprobes-ftrace.c | 81 +++++++++++++++++++ > > include/linux/kprobes.h | 2 + > > kernel/kprobes.c | 4 +- > > 6 files changed, 88 insertions(+), 3 deletions(-) > > create mode 100644 arch/arm64/kernel/probes/kprobes-ftrace.c > > Sorry for the slow reply on this, but I think this deserved to be split > into two patches: the first one reworking the core check_ftrace_location() > logic to work properly with branch-and-link style architectures, and the > second one adding support for arm64. I'd prefer we don't do this at all; there a bunch of issues with kprobes *not* taking an exception, since we get a dodgy not-quite-real pt_regs, and to clean up the existing issues the plan is: 1) Move ftrace over to ftrace_regs 2) Implement fprobes using ftrace_regs 3) Remove kretprobes ... and regular kprobes will need to take an exception (via BRK) to get a real pt_regs, so that can't be optimized to use ftrace. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel